# write /dev/stdout: broken pipe

- **ID:** `go/io-copy-write-error`
- **Domain:** go
- **Category:** io_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to write to a closed or broken pipe, often when the reader (e.g., head command) exits early.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.21 | active | — | — |

## Workarounds

1. **** (80% success)
   ```
   _, err := io.Copy(dst, src); if err != nil { if errors.Is(err, syscall.EPIPE) { /* handle gracefully */ } else { log.Fatal(err) } }
   ```

## Dead Ends

- **** — The pipe remains broken; retries will fail repeatedly. (90% fail)
- **** — May hide critical I/O issues and lead to data loss. (85% fail)
