-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: incomplete documentation on parameters for Dial, Listen and ListenPacket functions #17956
Comments
I think the docs are already pretty clear that the parameter takes a host name (of any form), but CLs are always welcome to improve docs. |
Host is not the appropriate word because the string represents a host and port pair, referred to as a socket (RFC 793). On the other hand, address makes sense to me and changing it seems unnecessary. |
Agreed. Let's stick with |
I don't think Dial or Listen treats only TCP (RFC 793) connection endpoints. For raw IP connection endpoints the argument for 2nd parameter must be a name or IP literal, and for Unix-domain connection endpoints the argument must be a filesystem path. If there is no appropriate word like |
Address is just a string, but the common case is host:port. Would it suffice to add examples of other address types than change the terminology at this point? |
@as, Probably, not sure. FWIW, when I saw the description of https://go-review.googlesource.com/27250 I couldn't parse it; what are the |
How about
|
CL https://golang.org/cl/34875 mentions this issue. |
CL https://golang.org/cl/34876 mentions this issue. |
This change clarifies the documentation on Listen and ListenPacket to avoid unnecessary confusion about how the arguments for the connection setup functions are used to make connections. Also replaces "name" or "hostname" with "host name" when the term implies the use of DNS. Updates #17613. Updates #17614. Updates #17615. Fixes #17616. Updates #17738. Updates #17956. Change-Id: I0bad2e143207666f2358d397fc076548ee6c3ae9 Reviewed-on: https://go-review.googlesource.com/34876 Reviewed-by: Ian Lance Taylor <iant@golang.org>
The current package documentation describes like the following:
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.The text was updated successfully, but these errors were encountered: