From 0f3becf62f3935846490e60e5005e1e4a55bec67 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 21 Dec 2021 12:23:53 -0800 Subject: [PATCH] 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 Trust: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick --- doc/go1.18.html | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/go1.18.html b/doc/go1.18.html index a1d1a725525..9c839bdc8f5 100644 --- a/doc/go1.18.html +++ b/doc/go1.18.html @@ -457,16 +457,46 @@ Do not send CLs removing the interior tags from such phrases. Prefix, representing a network CIDR prefix.

+

+ The package also defines several functions to create and examine + these new types: + AddrFrom4, + AddrFrom16, + AddrFromSlice, + AddrPortFrom, + IPv4Unspecified, + IPv6LinkLocalAllNodes, + IPv6Unspecified, + MustParseAddr, + MustParseAddrPort, + MustParsePrefix, + ParseAddr, + ParseAddrPort, + ParsePrefix, + PrefixFrom. +

The net package includes new methods that parallel existing methods, but return netip.AddrPort instead of the heavier-weight net.IP or - *net.UDPAddr types. + *net.UDPAddr types: + Resolver.LookupNetIP, + UDPConn.ReadFromUDPAddrPort, + UDPConn.ReadMsgUDPAddrPort, + UDPConn.WriteToUDPAddrPort, + UDPConn.WriteMsgUDPAddrPort. + The new UDPConn methods support allocation-free I/O. +

+

The net package also now includes functions and methods to convert between the existing TCPAddr/UDPAddr - types and netip.AddrPort. + types and netip.AddrPort: + TCPAddrFromAddrPort, + UDPAddrFromAddrPort, + TCPAddr.AddrPort, + UDPAddr.AddrPort.

Minor changes to the library