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

- **ID:** `go/select-on-empty-nil-channel`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A select with only nil channels (or a single nil channel) blocks forever because nil channels are never ready. Common when a channel is conditionally assigned nil to disable a case.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   select {
case v := <-ch:
    handle(v)
case <-ctx.Done():
    return ctx.Err()
}
   ```
2. **** (92% success)
   ```
   if ch == nil { return ErrNoChannel }
select { case v := <-ch: _ = v }
   ```

## Dead Ends

- **** — Turns the deadlock into a busy loop, pegging CPU and never making progress. (85% fail)
- **** — Unbuffered channel still blocks if no sender; same deadlock. (80% fail)
