1
0
mirror of https://github.com/golang/go synced 2024-11-11 23:40:22 -07:00

net, doc: document JoinHostPort change in release notes, clarify its docs

Updates #18059
Updates #20587

Change-Id: Icbb4c7cb201ac51d2cc6066620b47ba09ff6fe65
Reviewed-on: https://go-review.googlesource.com/45780
Reviewed-by: Chris Broadfoot <cbro@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-06-14 22:04:33 +00:00
parent 862e45d49d
commit 2f55031c59
2 changed files with 4 additions and 7 deletions

View File

@ -466,12 +466,9 @@ type T1 = T2
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&#39;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 -->

View File

@ -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.