Context Control in Go
Best practices for handling context plumbing.
Published: 2024-02-03
tl;dr
There are three main rules to observe when handling context plumbing in Go: only entry-point functions
should create new contexts, contexts are only passed down the call chain, and don’t store contexts
or otherwise use them after the function returns.
Context is one of the foundational building blocks in Go. Anyone with even a cursory experience
with the language is likely to have encountered it, as it’s the first argument...
Read more at zenhorace.dev