From 237b8b8b66113c081c1407251c0c605d1acdc730 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 26 Mar 2013 10:54:55 -0700 Subject: [PATCH] doc/go1.1.html: describe Zone and other net changes Mild adaptation of rsc's 8021043, which I was unable to clpatch. (rsc is offline) R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7741049 --- doc/go1.1.html | 72 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/doc/go1.1.html b/doc/go1.1.html index 01c43d248d..d08b1c3964 100644 --- a/doc/go1.1.html +++ b/doc/go1.1.html @@ -452,6 +452,26 @@ and methods.

+

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

+

reflect

@@ -730,19 +750,15 @@ to define the boundary separator used to package the output.

  • The 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.
  • -
  • TODO: -net: LookupNS, IPConn.ReadMsgIP, IPConn.WriteMsgIP, UDPConn.ReadMsgUDP, UDPConn.WriteMsgUDP, UnixConn.CloseRead, UnixConn.CloseWrite -
  • -
  • The net package includes a new function, DialOpt, to supply options to @@ -756,6 +772,48 @@ The new functions LocalAddress return a DialOption.
  • +
  • +The 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. +
  • + +
  • +The net package adds +LookupNS to its suite of resolving functions. +LookupNS returns the NS records for a host name. +
  • + +
  • +The 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. +
  • + +
  • +The net package adds methods to +UnixConn to allow closing half of the connection +(CloseRead and +CloseWrite), +matching the existing methods of TCPConn. +
  • +
  • The net/http package includes several new additions. ParseTime parses a time string, trying -- 2.50.0