net/http: zero-value Transport is leak-prone #19620
The documentation for http.Transport warns:
For users of the API, it may not be obvious that the idle connections may remain open even after the
It would be nice if the zero-value Transport represented a configuration that did not leak connections. Better still if we could find a way to automatically close the idle connections when the Transport becomes unreachable.
I don't think this is fixable in Go 1, but we should revisit this aspect of the API if/when we're thinking about Go 2.
I'm going to close this but I'll mark it as Go2.