# error: io: read/write on closed pipe (buffer too small for atomic write)

- **ID:** `go/io-copy-buffer-too-small`
- **Domain:** go
- **Category:** io_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using io.Copy with a buffer that is too small for atomic operations, causing partial writes and pipe closure.

## Version Compatibility

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

## Workarounds

1. **Use io.Copy with default buffer or specify larger buffer** (90% success)
   ```
   buf := make([]byte, 32*1024) // 32KB buffer
_, err := io.CopyBuffer(dst, src, buf)
if err != nil { /* handle */ }
   ```

## Dead Ends

- **Increasing buffer size arbitrarily** — May not fix underlying issue; use io.CopyBuffer with larger buffer. (50% fail)
