Is http.CloseNotify completely replaced by http.Request.Context (). Done ()?

Go 1.7 Added context to http.Request. Does it completely replace http.CloseNotify? Should I choose this now and not bother with CloseNotify?

+7
go
source share
1 answer

Yes, but only in Go 1.8+. APIs existed in Go 1.7, but only before Go 1.8 disconnected the client interface, the Request Context was called, so in Go 1.7 there was still a valid use of CloseNotifier.

(Source: I added โ€œcontextโ€ to the standard library and am the author of the net / http package.)

+17
source

All Articles