From 0f3becf62f3935846490e60e5005e1e4a55bec67 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor 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
.