From: Brad Fitzpatrick
- TODO: https://golang.org/cl/37402: implement deadline functionality on Pipe -
-
- TODO: https://golang.org/cl/40510: don't enclose non-literal IPv6 addresses in square brackets
+ JoinHostPort
now only places an address in square brackets if the host contains a colon.
+ In previous releases it would also wrap addresses in square brackets if they contained a percent ('%
') sign.
diff --git a/src/net/ipsock.go b/src/net/ipsock.go index 6049692d37..201c3f58bc 100644 --- a/src/net/ipsock.go +++ b/src/net/ipsock.go @@ -194,8 +194,8 @@ func splitHostZone(s string) (host, zone string) { } // JoinHostPort combines host and port into a network address of the -// form "host:port" or "host%zone:port", if host is a literal IPv6 -// address, "[host]:port" or [host%zone]:port. +// form "host:port". If host contains a colon, as found in literal +// IPv6 addresses, then JoinHostPort returns "[host]:port". func JoinHostPort(host, port string) string { // We assume that host is a literal IPv6 address if host has // colons.