# fatal error: all goroutines are asleep - deadlock!

- **ID:** `go/deadlock-unbuffered-channel-single-goroutine`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Sending on an unbuffered channel without a receiver in the same goroutine blocks forever, causing a deadlock.

## Version Compatibility

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

## Workarounds

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

## Dead Ends

- **** — Only works if the sender doesn't need to wait for a receiver; if the buffer fills, the same deadlock occurs. (70% fail)
- **** — Sleeping doesn't create a receiver; the goroutine still blocks indefinitely. (90% fail)
- **** — The program terminates immediately; no recovery is possible. (100% fail)
