# fatal error: all goroutines are asleep - deadlock! (select with no ready case)

- **ID:** `go/select-no-default-blocks`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A select statement with no default blocks until one case becomes ready. If no channel ever becomes ready, the program deadlocks.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.17 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   select {
case v := <-ch:
    use(v)
case <-time.After(5 * time.Second):
    return errTimeout
}
   ```
2. **** (96% success)
   ```
   select {
case v := <-ch:
    use(v)
case <-ctx.Done():
    return ctx.Err()
}
   ```

## Dead Ends

- **** — The select now spins in a busy loop consuming CPU without ever making progress. (70% fail)
- **** — Creates a livelock if no case is ever ready; the program hangs forever. (80% fail)
