net: FileConn() and Dial() only return public net.Conn implementations #27391
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
In Go 1.11 and 1.10, the documentation does not say anything about which implementations of
net.Conn
are actually returned bynet.Dial()
(and friends) andnet.FileConn()
.The current implementations of
net.Dial()
andnet.FileConn()
only return public implementations ofnet.Conn
(or an error). Taking advantage of this by type-asserting to the actual implementation returned by these functions/methods is extremely useful. As such, it would be nice to have this behavior documented so users can rely on it.I'll send out a CL to extend the documentation and a test or two shortly.
The text was updated successfully, but these errors were encountered: