Last Updated: May 22, 2026
Every *http.Request carries a context.Context that the server cancels when the client disconnects or the response is finished. This lesson covers how to pull that context out with r.Context(), propagate it into databases and downstream HTTP calls, attach per-request values like a request ID, and avoid the trap of starting goroutines that outlive the request.