# fatal error: all goroutines are asleep - deadlock! (empty select{})

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

## Root Cause

An empty select{} blocks the goroutine forever. If it's the main goroutine and nothing else can make progress, the runtime reports deadlock.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Block on a signal channel instead of empty select:

quit := make(chan os.Signal, 1)
signal.Notify(quit, os.Interrupt)
<-quit
   ```
2. **** (92% success)
   ```
   Use sync.WaitGroup to wait for real work completion:

wg.Wait()
   ```

## Dead Ends

- **** — Still blocks; program never exits and deadlock detection is defeated. (70% fail)
- **** — Goroutine leaks and main may exit before work completes. (60% fail)
