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

- **ID:** `go/fatal-error-all-goroutines-are-asleep-deadlock-nil-chan`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Receiving or sending on a nil channel blocks forever; a channel declared but never initialized with make is nil.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.16 | active | — | — |
| 1.19 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   ch := make(chan int, 1)
ch <- 1
v := <-ch
   ```
2. **** (90% success)
   ```
   if ch == nil {
    return errors.New("channel not initialized")
}
   ```

## Dead Ends

- **** — A nil channel case never becomes ready, so select with default just spins or returns default, never delivering data. (80% fail)
- **** — Closing a nil channel panics with 'close of nil channel'. (95% fail)
