Skip to content

net: incomplete documentation on parameters for Dial, Listen and ListenPacket functions #17956

@mikioh

Description

@mikioh

The current package documentation describes like the following:

func Dial(network, address string) (Conn, error)
    Dial connects to the address on the named network.

   (snip)

    For TCP and UDP networks, addresses have the form host:port. If host is
    a literal IPv6 address it must be enclosed in square brackets as in
    "[::1]:80" or "[ipv6-host%zone]:80". The functions JoinHostPort and
    SplitHostPort manipulate addresses in this form. If the host is empty,
    as in ":80", the local system is assumed.

It doesn't describe that the second parameter could be not only an IP address literal but a DNS/mDNS name or a name in local database. Also the parameter name address looks a bit confusing; host or other appropriate word would be better for avoiding unnecessary confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions