3 ms·
For a language which seems to have been intended initially for writing maintainable network services the absence of a means to set timeouts or cancel requests i
by shirro 6y ago
For a language which seems to have been intended initially for writing maintainable network services the absence of a means to set timeouts or cancel requests in the original network apis was clearly an oversight. I like what they have proposed with generics and other recent changes and I would like to see a fresh look at this problem.
Context is working as intended here as it returns a copy which is well documented. Cancellation and timeouts are useful but WithValue seems like a nasty hack to me. I think it should be avoided and possibly deprecated.
- dvt 6y agoThis is actually kind of funny (and true) as I was the one that implemented sensible HTTP timeouts in the standard library after a server I wrote oddly kept eternally open-connections[1]. [1] https://github.com/golang/go/issues/213 https://github.com/golang/go/issues/213