]> Cypherpunks repositories - gostls13.git/commitdiff
net: update documentation on JoinHostPort and SplitHostPort
authorMikio Hara <mikioh.mikioh@gmail.com>
Sun, 8 Jan 2017 08:29:26 +0000 (17:29 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Thu, 22 Jun 2017 08:34:21 +0000 (08:34 +0000)
This change adds a reference to the Dial to clarify the parameters and
return values.

Change-Id: I611b9a79f4033ef035acd7098aea5965905d9a4c
Reviewed-on: https://go-review.googlesource.com/34880
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/ipsock.go

index 201c3f58bc97b883da34f435370b117d8792a506..7dafcaf630093ab5d9305053bb1aebddac896361 100644 (file)
@@ -127,6 +127,9 @@ func ipv6only(addr IPAddr) bool {
 //
 // A literal IPv6 address in hostport must be enclosed in square
 // brackets, as in "[::1]:80", "[::1%lo0]:80".
+//
+// See func Dial for a description of the hostport parameter, and host
+// and port results.
 func SplitHostPort(hostport string) (host, port string, err error) {
        const (
                missingPort   = "missing port in address"
@@ -196,6 +199,8 @@ func splitHostZone(s string) (host, zone string) {
 // JoinHostPort combines host and port into a network address of the
 // form "host:port". If host contains a colon, as found in literal
 // IPv6 addresses, then JoinHostPort returns "[host]:port".
+//
+// See func Dial for a description of the host and port parameters.
 func JoinHostPort(host, port string) string {
        // We assume that host is a literal IPv6 address if host has
        // colons.