# fatal error: all goroutines are asleep - deadlock! (nil channel send)

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

## Root Cause

A goroutine attempted to send to a nil channel, which blocks forever. If no other goroutine can proceed, the runtime detects a deadlock.

## Version Compatibility

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

## Workarounds

1. **** (98% success)
   ```
   ch := make(chan int)
// or ch := make(chan int, 1)
   ```
2. **** (90% success)
   ```
   select {
case ch <- v:
case <-time.After(1 * time.Second):
    return errors.New("timeout: channel may be nil")
}
   ```

## Dead Ends

- **** — A nil channel in a select will never be ready, so the default case will always be taken, silently dropping the send. (90% fail)
- **** — Checking for nil is not atomic and does not guarantee the channel is initialized; it may still be nil at send time. (85% fail)
