A client hangs up halfway through a request. How do you structure a Go HTTP service so it stops doing the work?
Go context cancellation stops wasted request work when the client disconnects or a timeout expires. Pass the request context into database, HTTP and worker calls, and make goroutines return when ctx.Done closes.