Skip to content

net: FileConn() and Dial() only return public net.Conn implementations #27391

Open
@dfinkel

Description

@dfinkel

In Go 1.11 and 1.10, the documentation does not say anything about which implementations of net.Conn are actually returned by net.Dial() (and friends) and net.FileConn().

The current implementations of net.Dial() and net.FileConn() only return public implementations of net.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions