~/talk

The context package internals

Talkat GopherCon UK 2023 · 2023-08-16..08-18· [go]
slides:none on file

Examines Go's context internals by reading the std lib: actual types are emptyContext, valueContext, cancelContext and a timer-backed context, with concrete code for WithValue/Value traversal (no map, it walks a parent chain), WithCancel wiring parent↔child links and a lazily created done channel, cancel propagation that closes done and removes child links, WithDeadline/WithTimeout using timers that stop to avoid leaks, and the Go 1.20 addition WithCancelCodes for propagating cancel reasons; all examples compile and demonstrate the propagation behavior.

AI-written summary · about

  1. 0:00Introduction
  2. 1:25Context package overview
  3. 3:31Initial contexts Background TODO
  4. 6:39Storing retrieving values
  5. 14:44Cancellation signals propagation
  6. 34:12Cancellation with error codes
  7. 34:34Deadlines in contexts
  8. 48:31Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.