typeover
curriculum

Curriculum Idioms & ecosystem Context exercise 5 · fill-word

Context

After a context is cancelled, this method returns a non-nil error describing WHY: context.Canceled (explicit cancel) or context.DeadlineExceeded (WithTimeout/WithDeadline expired). Type the method name.

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.