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

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

## Root Cause

Sending or receiving on a nil channel blocks forever, leading to deadlock if all goroutines are blocked.

## Version Compatibility

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

## Workarounds

1. **** (98% success)
   ```
   ch := make(chan int)
   ```
2. **** (90% success)
   ```
   if ch != nil {
    ch <- v
}
   ```

## Dead Ends

- **** — Timeout on nil channel still blocks; select with timeout won't trigger (90% fail)
- **** — Default case may cause busy loop (70% fail)
