# error: context deadline exceeded (from select ctx.Done())

- **ID:** `go/context-deadline-exceeded-in-select`
- **Domain:** go
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A select statement observes ctx.Done() because the parent context's deadline elapsed. The downstream operation is cancelled, but the caller treats it as a generic error.

## Version Compatibility

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

## Workarounds

1. **** (96% success)
   ```
   select {
case <-ctx.Done():
    return ctx.Err()
case res := <-ch:
    return res
}
   ```
2. **** (90% success)
   ```
   for i := 0; i < 3; i++ {
    ctx, cancel := context.WithTimeout(parent, 2*time.Second)
    err := call(ctx)
    cancel()
    if err == nil { return nil }
}
   ```

## Dead Ends

- **** — The deadline is fixed; every retry burns the same expired context and returns instantly. (95% fail)
- **** — Callers receive silently wrong results and downstream logic corrupts data. (90% fail)
