Curriculum Idioms & ecosystem Context exercise 4 · fill-word
Context
Type the method on context.Context that returns the
channel which closes on cancellation. Receive from this
channel in a select to detect cancellation.
TypeScript reference
Fill the blanks →
About this theme
context.Context propagates cancellation, deadlines, and request-scoped values across goroutines and API boundaries. By convention, the first argument of any function that does I/O or starts a goroutine is ctx context.Context. Listening for <-ctx.Done() is how you write cancellable work.