News for hackers. Stuff that matters.
Re:Go Concurrency Patterns: Context by 2mur on Tuesday July 29, 2014 @01:07PM (#8103343)
Probably something like:

    // h already has a context.Context in scope through similar
    func MyHandler (ctx context.Context, h http.Handler) http.Handler {
       return http.HandlerFunc(func (rw http.ResponseWriter, req *http.Request) {
           // do stuff before handler
           h.serveHttp(rw, req)
           // do stuff after handler
       })
    }
then you can just chain your handlers and pass through a shared context
Re:Go Concurrency Patterns: Context by carbocation on Tuesday July 29, 2014 @02:00PM (#8103734)
In Interpose, that's exactly the pattern I use to pull in methods that require context while still satisfying the http.Handler interface (e.g., https://github.com/carbocation/interpose/blob/master/example... ), so it seems that this pattern would work well with Google's Context.