context.Context
Francesc Campoy and Isobel Redelmeier joins the panel to discuss Go’s context package including real-world insights into its use and misuse.
Francesc Campoy and Isobel Redelmeier joins the panel to discuss Go’s context package including real-world insights into its use and misuse.
Discussion
Sign in or Join to comment or subscribe
DeedleFake
2020-08-27T15:17:01Z ago
You mentioned cancelling contexts when signals are received for command-line tools. I also use that pattern quite a bit. I even made a proposal for it to be officially supported right after context was added to the standard library, but it was rejected: https://github.com/golang/go/issues/16472
Steve Coffman
2020-09-23T14:44:04Z ago
Francesc Campoy mentions a context value keying strategy he used in a log package, and I wasn’t quite able to follow his example. Does anyone know if there is an example (or a link to the log package he mentioned)?