diff --git a/doc/go1.2.html b/doc/go1.2.html new file mode 100644 index 0000000000..2e86eb0f74 --- /dev/null +++ b/doc/go1.2.html @@ -0,0 +1,577 @@ + + +

Introduction to Go 1.2

+ +

+RED TEXT IS FROM THE 1.1 DOC AND NEEDS TO BE UPDATED. (It is here for +formatting and style reference.) +

+ +The release of Go version 1 (Go 1 or Go 1.0 for short) +in March of 2012 introduced a new period +of stability in the Go language and libraries. +That stability has helped nourish a growing community of Go users +and systems around the world. +Several "point" releases since +then—1.0.1, 1.0.2, and 1.0.3—have been issued. +These point releases fixed known bugs but made +no non-critical changes to the implementation. + +

+ +

+ +This new release, Go 1.1, keeps the promise +of compatibility but adds a couple of significant +(backwards-compatible, of course) language changes, has a long list +of (again, compatible) library changes, and +includes major work on the implementation of the compilers, +libraries, and run-time. +The focus is on performance. +Benchmarking is an inexact science at best, but we see significant, +sometimes dramatic speedups for many of our test programs. +We trust that many of our users' programs will also see improvements +just by updating their Go installation and recompiling. + +

+ +

+ +This document summarizes the changes between Go 1 and Go 1.2. +Very little if any code will need modification to run with Go 1.1, +although a couple of rare error cases surface with this release +and need to be addressed if they arise. +Details appear below; see the discussion of XXX. + +

+ +

Changes to the language

+ +

+ +The Go compatibility document promises +that programs written to the Go 1 language specification will continue to operate, +and those promises are maintained. +In the interest of firming up the specification, though, there are +details about some error cases that have been clarified. +There are also some new language features. + +

+ +

Three-index slices

+ +

+cmd/gc: three-index slicing to set cap as well as length (CL 10743046). +

+ + +

Changes to the implementations and tools

+ + + +

Status of gccgo

+ +

+ +The GCC release schedule does not coincide with the Go release schedule, so some skew is inevitable in +gccgo's releases. +The 4.8.0 version of GCC shipped in March, 2013 and includes a nearly-Go 1.1 version of gccgo. +Its library is a little behind the release, but the biggest difference is that method values are not implemented. +Sometime around July 2013, we expect 4.8.2 of GCC to ship with a gccgo +providing a complete Go 1.1 implementaiton. + +

+ +

TODO

+ +

+TODO: write prose +

+ + + +

Changes to the go command

+ + + + +

Additional platforms

+ +

+ +The Go 1.1 tool chain adds experimental support for freebsd/arm, +netbsd/386, netbsd/amd64, netbsd/arm, +openbsd/386 and openbsd/amd64 platforms. + +

+ +

+ +An ARMv6 or later processor is required for freebsd/arm or +netbsd/arm. + +

+ +

+ +Go 1.1 adds experimental support for cgo on linux/arm. + +

+ +

Performance

+ +

+ +The performance of code compiled with the Go 1.1 gc tool suite should be noticeably +better for most Go programs. +Typical improvements relative to Go 1.0 seem to be about 30%-40%, sometimes +much more, but occasionally less or even non-existent. +There are too many small performance-driven tweaks through the tools and libraries +to list them all here, but the following major changes are worth noting: + +

+ + + +

Changes to the standard library

+ +

foo.Bar

+ +

+TODO: choose which to call out + +The various routines to scan textual input in the +bufio +package, +ReadBytes, +ReadString +and particularly +ReadLine, +are needlessly complex to use for simple purposes. +In Go 1.1, a new type, +Scanner, +has been added to make it easier to do simple tasks such as +read the input as a sequence of lines or space-delimited words. +It simplifies the problem by terminating the scan on problematic +input such as pathologically long lines, and having a simple +default: line-oriented input, with each line stripped of its terminator. +Here is code to reproduce the input a line at a time: + + +

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

+ + + +

Exp and old subtrees moved to go.exp and go.text subrepositories

+ +

+ +To make it easier for binary distributions to access them if desired, the exp +and old source subtrees, which are not included in binary distributions, +have been moved to the new go.exp subrepository at +code.google.com/p/go.exp. To access the ssa package, +for example, run + +

+ +

New packages

+ +

+ +There are three new packages. + +

+ + + +

Minor changes to the library

+ +

+The following list summarizes a number of minor changes to the library, mostly additions. +See the relevant package documentation for more information about each change. +

+ + diff --git a/doc/go1.2.txt b/doc/go1.2.txt deleted file mode 100644 index 11b7b9e12e..0000000000 --- a/doc/go1.2.txt +++ /dev/null @@ -1,82 +0,0 @@ -This file collects notes about what has changed since Go 1.1 -and should be mentioned in the Go 1.2 release notes. -During the Go 1.2 release process it will be necessary to convert -it to HTML, similar to go1.1.html, but for now it is a text file, -to make the process of keeping it up-to-date more lightweight. - -Please keep the descriptions to a single line, starting with the -package or cmd/xxx directory name, and ending in a CL number. -Please keep the list sorted (as in sort.Strings of the lines). - -Performance: -compress/bzip2: faster decompression by 30% (CL 9915043). -crypto/des: 5x faster encoding/decoding (CL 11874043, 12072045). -encoding/json: faster encoding (CL 9129044). -net: improve windows performance by up to 30% (CL 8670044). -net: improve performance on BSD by up to 30% (CL 8264043, 12927048, 13080043). - -Breaking change: -archive/tar,archive/zip: fix os.FileInfo implementation to provide base name only (CL 13118043). - -cmd/5a: removed support for R9/R10 (use m/g instead) (CL 9840043). -cmd/5l: add MOVBS, MOVHS etc for sub-word moves (CL 12682043). -cmd/5l: support for external linking for linux/arm (CL 12871044). -cmd/cgo, cmd/go: support including C++ code with cgo (CL 8248043). -cmd/gc: three-index slicing to set cap as well as length (CL 10743046). -cmd/gc: make missing package error fatal (CL 12677043). -cmd/go: test coverage (CL 10413044). -cmd/go: add -t flag to 'go get' to download test dependencies (CL 12566046). -cmd/go: delete 'go doc' (CL 12974043). - -archive/zip: add File.DataOffset accessor (CL 12784045). -bufio: add Reset methods to Reader and Writer (CL 12603049). -compress/bzip2: support concatenated files (CL 12387044). -compress/flate: add Reset method on Writer (CL 12265043). -compress/gzip: add Reset method on Writer (CL 13435043). -container/heap: added Fix (CL 12265043). -container/list: added MoveBefore and MoveAfter (CL 12021044). -crypto/cipher: AES-GCM mode (CL 12375043). -crypto/md5: Sum function to simplify hashing (CL10624044). -crypto/sha1: Sum function to simplify hashing (CL 10571043). -crypto/sha256: Sum256 and Sum224 functions to simplify hashing (CL 10629043). -crypto/sha512: Sum512 and Sum384 functions to simplify hashing (CL 10630043). -crypto/x509: add support for reading and writing arbitrary extensions (CL 12056043). -crypto/tls: add support for TLS 1.1, 1.2 and AES-GCM. (CL 7872043, 10762044 and 13249044). -database/sql: add SetMaxOpenConns method on DB (CL 10726044). -encoding: new package defining generic encoding interfaces (CL 12541051). -encoding/csv: always allow trailing commas (CL 12294043). -encoding/gob: support generic encoding interfaces (CL 12681044). -encoding/json: accept but correct invalid UTF-8 in Marshal (CL 11211045). -encoding/json: always escape ampersands (CL 12708044). -encoding/json: support generic encoding interfaces (CL 12703043). -encoding/xml: allow attributes stored in pointers to be marshaled (CL 8653047). -encoding/xml: add Marshaler, MarshalerAttr interfaces (CL 12919043). -encoding/xml: add Unmarshaler, UnmarshalerAttr interfaces (CL 12556043). -encoding/xml: support generic encoding interfaces (CL 12751045). -flag: add Getter interface (CL 10472043). -flag: export commandLine (now CommandLine) (CL 12587043). -fmt: indexed access to arguments in Printf etc. (CL 9680043). -go/build: support including C++ code with cgo (CL 8248043). -go/build: add Package.AllTags (CL 12703044). -image/draw: added Drawer, FloydSteinberg and the op.Draw method (CL 10977043). -image/draw: added Quantizer type (CL 11148043). -image/gif: added Encode and EncodeAll (CL 10896043). -io: Copy prioritizes WriterTo over ReaderFrom (CL 9462044). -net: new build tag netgo for building a pure Go net package (CL 7100050). -net/http: don't allow sending invalid cookie lines (CL 12204043). -net/http: allow ReadResponse with nil *Request parameter (CL 9821043). -net/http: allow responses to HEAD requests, detect type and length (CL 12583043). -runtime: relax constraint on finalizer func in SetFinalizer (CL 12895043). -runtime: preemption of goroutines at function entry (CL 12371043). -sort: new Stable function provides stable sort (CL 9612044). -strings: add IndexByte, for consistency with bytes package (CL 12214044). -sync/atomic: add Swap functions (CL 12670045). -syscall: implemented Sendfile for Darwin, added Syscall9 for Darwin/amd64 (CL 10980043). -testing: AllocsPerRun is now quantized to an integer (the type is still float64) (CL 9837049). -testing: add TB interface (intersection of T and B's methods) (CL 12962043). -text/template: add comparison functions (CL 13091045). -text/template: dereference pointer values when evaluating args escape funcs (CL 13257043). -text/template: allow {{else if ... }} to simplify if chains (CL 13327043). -time: Allow Parse and Format to handle time zone offsets with seconds (CL 8132044) -time: patterns require non-lowercase letter to follow Mon, Jan etc (CL 12448044). -unicode: add In, a nicer-to-use but equivalent version of IsOneOf (CL 11672044).