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

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

## Root Cause

A select statement with all nil channels blocks forever, as nil channels never become ready.

## Version Compatibility

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

## Workarounds

1. **Always include a default case or non-nil channel in select** (95% success)
   ```
   select {
case <-ch1:
case <-ch2:
default:
    // avoid deadlock
}
   ```
2. **Ensure at least one channel is non-nil before select** (90% success)
   ```
   if ch1 == nil && ch2 == nil {
    return // or handle
}
select {
case <-ch1:
case <-ch2:
}
   ```

## Dead Ends

- **Adding a default case that does nothing** — Default case executes immediately, but if omitted, all-nil select blocks. (70% fail)
- **Using time.After in select** — time.After returns a non-nil channel, so select won't have all nil channels. (40% fail)
