# panic: send on closed channel

- **ID:** `go/channel-send-on-closed`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Sending data to a channel that has been closed by another goroutine without proper synchronization.

## Version Compatibility

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

## Workarounds

1. **** (85% success)
   ```
   Ensure the sender knows when to stop. Use a done channel to signal closure, and only close the channel from the sender side.
   ```
2. **** (90% success)
   ```
   Use sync.Once to close the channel only once, ensuring no other sender attempts to send after close.
   ```

## Dead Ends

- **** — The panic is fatal and cannot be recovered; it will crash the program. (90% fail)
- **** — len() does not indicate whether a channel is closed, only the number of buffered elements. (95% fail)
- **** — The close operation may still race with the send; mutex does not prevent closing while sending. (70% fail)
