# fatal error: all goroutines are asleep - deadlock!

- **ID:** `go/channel-deadlock-no-receiver`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Sending to an unbuffered channel with no concurrent receiver blocks the only goroutine, leaving no runnable goroutines and triggering the runtime deadlock detector.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   ch := make(chan int)
go func() { fmt.Println(<-ch) }()
ch <- 42
   ```
2. **** (90% success)
   ```
   ch := make(chan int, 1)
ch <- 42 // does not block
fmt.Println(<-ch)
   ```

## Dead Ends

- **** — Still no receiver ever reads, the spawned goroutine blocks forever and the main goroutine exits or deadlocks elsewhere. (70% fail)
- **** — Sleep does not create a receiver; if no goroutine reads, the send still blocks permanently. (85% fail)
