From bfeb79bae5e27977d1b82e8ffa4bf08c0a9d33fa Mon Sep 17 00:00:00 2001
From: Rob Pike
-TODO
+Go 1.1 now implements
+method values,
+which are functions that have been bound to a specific receiver value.
+For instance, given a
+
+Method values are distinct from method expressions, which generate functions
+from methods of a given type; the method expression
+Updating: No existing code is affected; the change is strictly backward-compatible.
-TODO: more
-
@@ -193,7 +221,7 @@ some editors add them as a kind of "magic number" identifying a UTF-8 encoded fi
Updating:
Most programs will be unaffected by the surrogate change.
Programs that depend on the old behavior should be modified to avoid the issue.
-The byte-order-mark change is strictly backwards-compatible.
+The byte-order-mark change is strictly backward-compatible.
Method values
Writer
+value w
,
+the expression
+w.Write
,
+a method value, is a function that will always write to w
; it is equivalent to
+a function literal closing over w
:
+
+func (p []byte) (n int, err error) {
+ return w.Write(n, err)
+}
+
+
+(*bufio.Writer).Write
+is equivalent to a function with an extra first argument, a receiver of type
+(*bufio.Writer)
:
+
+func (w *bufio.Writer, p []byte) (n int, err error) {
+ return w.Write(n, err)
+}
+
+
+Return requirements
@@ -88,10 +120,6 @@ Such code can be identified by go vet
.
Changes to the implementations and tools
-Command-line flag parsing
The gc assemblers
@@ -206,7 +234,9 @@ to adjust frame pointer offsets.
-TODO: Point to cmd/vet once it handles this.
+Updating:
+The go vet
command now checks that functions implemented in assembly
+match the Go function prototypes they implement.
The go test
command no longer deletes the binary when run with profiling enabled,
to make it easier to analyze the profile.
@@ -265,7 +297,20 @@ $ go test -cpuprofile cpuprof.out mypackage
the file mypackage.test
will be left in the directory where go test
was run.
+The go test
command can now generate profiling information
+that reports where goroutines are blocked, that is,
+where they tend to stall waiting for an event such as a channel communication.
+The information is presented as a
+blocking profile
+enabled with the
+-blockprofile
+option of
+go test
.
+Run go help test
for more information.
+
The fix
command, usually run as
@@ -408,14 +453,6 @@ only T
.
-TODO:
-runtime
: BlockProfile
-
On FreeBSD, Linux, NetBSD, OS X and OpenBSD, previous versions of the @@ -643,6 +680,18 @@ has a new method for its to define the boundary separator used to package the output. +
net
package's
+net/ListenUnixgram
+function has changed return types: it now returns a
+net/UnixConn
+rather than a
+net/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.
+html/template
packages,
templates can now use parentheses to group the elements of pipelines, simplifying the construction of complex pipelines.
TODO: Link to example.
+Also, as part of the new parser, the
+Node
interface got two new methods to provide
+better error reporting.
+Although this violates the Go 1 compatibility rules,
+no existing code should be affected because this interface is explicitly intended only to be used
+by the
+text/template
+and
+html/template
+packages and there are safeguards to guarantee that.