# fatal error: all goroutines are asleep - deadlock! (receive from closed channel)

- **ID:** `go/channel-receive-from-closed-channel-ok`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A goroutine is blocked receiving from a channel that is closed and empty, but other goroutines are also blocked, leading to a deadlock.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   v, ok := <-ch
if !ok {
    return
}
   ```
2. **** (98% success)
   ```
   for v := range ch {
    // process v
}
   ```

## Dead Ends

- **** — Sleep does not unblock a deadlock; it only delays the inevitable fatal error (95% fail)
- **** — The deadlock is logical, not related to parallelism (90% fail)
