()
| 271 | } |
| 272 | |
| 273 | func generateBoundary() string { |
| 274 | b := make([]byte, 16) |
| 275 | if _, err := rand.Read(b); err != nil { |
| 276 | // crypto/rand failure means the OS RNG is broken — nothing |
| 277 | // downstream will work either. Panic so the caller surfaces a |
| 278 | // 500 rather than silently emitting an all-zero boundary that |
| 279 | // could collide across messages. |
| 280 | panic(fmt.Sprintf("compose: crypto/rand failed: %v", err)) |
| 281 | } |
| 282 | return fmt.Sprintf("e2a_%x", b) |
| 283 | } |
no test coverage detected