From: Rob Pike Date: Fri, 22 Mar 2013 22:45:16 +0000 (-0700) Subject: doc/go1.1.html: blockprofile, method values, ListenUnixgram, etc. X-Git-Tag: go1.1rc2~368 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bfeb79bae5e27977d1b82e8ffa4bf08c0a9d33fa;p=gostls13.git doc/go1.1.html: blockprofile, method values, ListenUnixgram, etc. R=golang-dev, gri CC=golang-dev https://golang.org/cl/7496051 --- diff --git a/doc/go1.1.html b/doc/go1.1.html index a02298f71e..050a129fab 100644 --- a/doc/go1.1.html +++ b/doc/go1.1.html @@ -48,7 +48,39 @@ See the Unicode section for more information.

Method values

-TODO +Go 1.1 now implements +method values, +which are functions that have been bound to a specific receiver value. +For instance, given a +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)
+}
+
+ +

+Method values are distinct from method expressions, which generate functions +from methods of a given type; the method expression (*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)
+}
+
+ +

+Updating: No existing code is affected; the change is strictly backward-compatible.

Return requirements

@@ -88,10 +120,6 @@ Such code can be identified by go vet.

Changes to the implementations and tools

-

-TODO: more -

-

Command-line flag parsing

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

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.

Changes to the go command

@@ -251,6 +281,8 @@ warning: GOPATH set to GOROOT (/home/User/go) has no effect package code.google.com/p/foo/quxx: cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath +

Changes to the go test command

+

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.

-

Changes to go fix

+

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

+ +

Changes to the go fix command

The fix command, usually run as @@ -408,14 +453,6 @@ only T.

- -

runtime

- -

-TODO: -runtime: BlockProfile -

-

time

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

  • +The +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. +
  • +
  • The new net/http/cookiejar package provides the basics for managing HTTP cookies.
  • @@ -748,6 +797,16 @@ and 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.