Closed as not planned
Description
What version of Go are you using (go version
)?
Go 1.14
Does this issue reproduce with the latest release?
Yes, as well as 1.13.8.
What did you do?
When using a custom net.Listener
there was a case where a nil net.Conn
could be returned, along with a nil error. The listen function doesn't check whether or not the connection coming from Accept is nil: https://golang.org/src/net/http/server.go?s=90476:90522#L2901
This can lead to a hard to track down panic, because if this happens e.g. on program shutdown whether you actually see the panic or not may be timing-dependent.
I should note that the net.Listener
documentation does not say that it is required to return a non-nil net.Conn
if err is nil.
What did you expect to see?
A proper nil check.
What did you see instead?
A panic.