From: Rob Pike
+The data structures
+IPAddr
,
+TCPAddr
, and
+UDPAddr
+add a new string field called Zone
.
+Code using untagged composite literals (e.g. net.TCPAddr{ip, port}
)
+instead of tagged literals (net.TCPAddr{IP: ip, Port: port}
)
+will break due to the new field.
+The Go 1 compatibility rules allow this change: client code must use tagged literals to avoid such breakages.
+
+Updating:
+To correct breakage caused by the new struct field,
+go fix
will rewrite code to add tags for these types.
+More generally, go vet
will identify composite literals that
+should be revised to use field tags.
+
@@ -730,19 +750,15 @@ to define the boundary separator used to package the output.
net
package's
-net/ListenUnixgram
+ListenUnixgram
function has changed return types: it now returns a
-net/UnixConn
+UnixConn
rather than a
-net/UDPConn
, which was
+UDPConn
, which was
clearly a mistake in Go 1.0.
Since this API change fixes a bug, it is permitted by the Go 1 compatibility rules.
net
: LookupNS, IPConn.ReadMsgIP, IPConn.WriteMsgIP, UDPConn.ReadMsgUDP, UDPConn.WriteMsgUDP, UnixConn.CloseRead, UnixConn.CloseWrite
-net
package includes a new function,
DialOpt
, to supply options to
@@ -756,6 +772,48 @@ The new functions
LocalAddress
return a DialOption
.
net
package adds support for
+link-local IPv6 addresses with zone qualifiers, such as fe80::1%lo0
.
+The address structures IPAddr
,
+UDPAddr
, and
+TCPAddr
+record the zone in a new field, and functions that expect string forms of these addresses, such as
+Dial
,
+ResolveIPAddr
,
+ResolveUDPAddr
, and
+ResolveTCPAddr
,
+now accept the zone-qualified form.
+net
package adds
+LookupNS
to its suite of resolving functions.
+LookupNS
returns the NS records for a host name.
+net
package adds protocol-specific
+packet reading and writing methods to
+IPConn
+(ReadMsgIP
+and WriteMsgIP
) and
+UDPConn
+(ReadMsgUDP
and
+WriteMsgUDP
).
+These are specialized versions of PacketConn
's
+ReadFrom
and WriteTo
methods that provide access to out-of-band data associated
+with the packets.
+ net
package adds methods to
+UnixConn
to allow closing half of the connection
+(CloseRead
and
+CloseWrite
),
+matching the existing methods of TCPConn
.
+net/http
package includes several new additions.
ParseTime
parses a time string, trying