context.Context carries cancellation signals, deadlines and request-scoped values through call chains. Pass it as the first parameter, honour ctx.Done() in loops and blocking calls, and derive child contexts with WithTimeout or WithCancel.
← Go theorytheory 0/50 · 0%
Concurrency · medium
25. Context
Deadlines, cancellation and request scope.
Check your understanding
1. Context should be passed as…
2. Which channel reports cancellation?