Updates #18059
Updates #20587
Change-Id: Icbb4c7cb201ac51d2cc6066620b47ba09ff6fe65
Reviewed-on: https://go-review.googlesource.com/45780
Reviewed-by: Chris Broadfoot <cbro@golang.org>
TODO: <a href="https://golang.org/cl/37260">https://golang.org/cl/37260</a>: allow Resolver to use a custom dialer
</p>
- <p><!-- CL 37402 -->
- TODO: <a href="https://golang.org/cl/37402">https://golang.org/cl/37402</a>: implement deadline functionality on Pipe
- </p>
-
<p><!-- CL 40510 -->
- TODO: <a href="https://golang.org/cl/40510">https://golang.org/cl/40510</a>: don't enclose non-literal IPv6 addresses in square brackets
+ <a href="/pkg/net/#JoinHostPort"><code>JoinHostPort</code></a> 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 ('<code>%</code>') sign.
</p>
<p><!-- CL 40512 -->
}
// 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.