# fatal error: all goroutines are asleep - deadlock! (range over channel)

- **ID:** `go/channel-range-without-close`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Ranging over a channel that is never closed and has no more values blocks forever.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   ch := make(chan int)
go func() { defer close(ch); for i:=0;i<5;i++ { ch<-i } }()
for v := range ch {
    fmt.Println(v)
}
   ```
2. **** (90% success)
   ```
   for {
    select {
    case v, ok := <-ch:
        if !ok { return }
        fmt.Println(v)
    case <-time.After(time.Second):
        return
    }
}
   ```

## Dead Ends

- **** — Break only exits if condition met; if no values, still blocks. (70% fail)
- **** — Range doesn't support timeout; need select. (90% fail)
- **** — If the channel is never sent to, still blocks. (60% fail)
