doc/go1.18: list new net/netip and net functions and methods

For #46518
For #47694

Change-Id: I4848556674baf85ceec350645d9eddcd83f1b2e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/373834
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ian Lance Taylor 2021-12-21 12:23:53 -08:00
parent d7b035f930
commit 0f3becf62f

View file

@ -457,16 +457,46 @@ Do not send CLs removing the interior tags from such phrases.
<a href="/pkg/net/netip/#Prefix"><code>Prefix</code></a>, representing <a href="/pkg/net/netip/#Prefix"><code>Prefix</code></a>, representing
a network CIDR prefix. a network CIDR prefix.
</p> </p>
<p>
The package also defines several functions to create and examine
these new types:
<a href="/pkg/net/netip#AddrFrom4"><code>AddrFrom4</code></a>,
<a href="/pkg/net/netip#AddrFrom16"><code>AddrFrom16</code></a>,
<a href="/pkg/net/netip#AddrFromSlice"><code>AddrFromSlice</code></a>,
<a href="/pkg/net/netip#AddrPortFrom"><code>AddrPortFrom</code></a>,
<a href="/pkg/net/netip#IPv4Unspecified"><code>IPv4Unspecified</code></a>,
<a href="/pkg/net/netip#IPv6LinkLocalAllNodes"><code>IPv6LinkLocalAllNodes</code></a>,
<a href="/pkg/net/netip#IPv6Unspecified"><code>IPv6Unspecified</code></a>,
<a href="/pkg/net/netip#MustParseAddr"><code>MustParseAddr</code></a>,
<a href="/pkg/net/netip#MustParseAddrPort"><code>MustParseAddrPort</code></a>,
<a href="/pkg/net/netip#MustParsePrefix"><code>MustParsePrefix</code></a>,
<a href="/pkg/net/netip#ParseAddr"><code>ParseAddr</code></a>,
<a href="/pkg/net/netip#ParseAddrPort"><code>ParseAddrPort</code></a>,
<a href="/pkg/net/netip#ParsePrefix"><code>ParsePrefix</code></a>,
<a href="/pkg/net/netip#PrefixFrom"><code>PrefixFrom</code></a>.
</p>
<p> <p>
The <a href="/pkg/net/"><code>net</code></a> package includes new The <a href="/pkg/net/"><code>net</code></a> package includes new
methods that parallel existing methods, but methods that parallel existing methods, but
return <code>netip.AddrPort</code> instead of the return <code>netip.AddrPort</code> instead of the
heavier-weight <a href="/pkg/net/#IP"><code>net.IP</code></a> or heavier-weight <a href="/pkg/net/#IP"><code>net.IP</code></a> or
<a href="/pkg/net/#UDPAddr"><code>*net.UDPAddr</code></a> types. <a href="/pkg/net/#UDPAddr"><code>*net.UDPAddr</code></a> types:
<a href="/pkg/net/#Resolver.LookupNetIP"><code>Resolver.LookupNetIP</code></a>,
<a href="/pkg/net/#UDPConn.ReadFromUDPAddrPort"><code>UDPConn.ReadFromUDPAddrPort</code></a>,
<a href="/pkg/net/#UDPConn.ReadMsgUDPAddrPort"><code>UDPConn.ReadMsgUDPAddrPort</code></a>,
<a href="/pkg/net/#UDPConn.WriteToUDPAddrPort"><code>UDPConn.WriteToUDPAddrPort</code></a>,
<a href="/pkg/net/#UDPConn.WriteMsgUDPAddrPort"><code>UDPConn.WriteMsgUDPAddrPort</code></a>.
The new <code>UDPConn</code> methods support allocation-free I/O.
</p>
<p>
The <code>net</code> package also now includes functions and methods The <code>net</code> package also now includes functions and methods
to convert between the existing to convert between the existing
<a href="/pkg/net/#TCPAddr"><code>TCPAddr</code></a>/<a href="/pkg/net/#UDPAddr"><code>UDPAddr</code></a> <a href="/pkg/net/#TCPAddr"><code>TCPAddr</code></a>/<a href="/pkg/net/#UDPAddr"><code>UDPAddr</code></a>
types and <code>netip.AddrPort</code>. types and <code>netip.AddrPort</code>:
<a href="/pkg/net/#TCPAddrFromAddrPort"><code>TCPAddrFromAddrPort</code></a>,
<a href="/pkg/net/#UDPAddrFromAddrPort"><code>UDPAddrFromAddrPort</code></a>,
<a href="/pkg/net/#TCPAddr.AddrPort"><code>TCPAddr.AddrPort</code></a>,
<a href="/pkg/net/#UDPAddr.AddrPort"><code>UDPAddr.AddrPort</code></a>.
</p> </p>
<h3 id="minor_library_changes">Minor changes to the library</h3> <h3 id="minor_library_changes">Minor changes to the library</h3>