← All releases

go1.1.0

Major

May 13, 2013

Go 1.1 stays fully Go 1-compatible while adding method values, a relaxed missing-return rule, 64-bit ints on 64-bit platforms, a built-in race detector, and broad speedups (often 30-40%) across the compiler, runtime, and GC.

highlights
  • Integer division by a constant zero is now a compile-time error instead of a runtime panic.

  • Method values added: an expression like w.Write now yields a function value bound to receiver w.

  • New terminating-statement rule lets many functions omit a final explicit return (e.g. infinite for loops, if-else where both branches return).

  • int and uint are now 64 bits on 64-bit platforms (previously 32 bits everywhere), enabling slices over 2 billion elements; code assuming 32-bit int truncation behavior can change results.

  • Max heap size on 64-bit architectures raised from a few gigabytes to tens of gigabytes; 32-bit heap limits unchanged.

  • New built-in race detector: go build/test/run -race flag finds concurrent read/write bugs (Linux, Mac OS X, Windows on 64-bit x86 only).

  • Unicode surrogate halves (U+D800-DFFF) are now rejected as invalid rune/string literals and as UTF-8/UTF-16 encodings, decoding to the replacement character instead.

  • go get now requires a valid GOPATH and no longer defaults to downloading into GOROOT; it also errors if GOPATH equals GOROOT.

  • go test keeps the compiled test binary when profiling is enabled, and adds a -blockprofile flag for goroutine blocking profiles.

  • New bufio.Scanner type simplifies reading input line-by-line or word-by-word.

  • Broad performance work yields typical 30-40% speedups via better codegen, more inlining, a lower-overhead map implementation, and a more parallel, more precise garbage collector.

  • New go1.1 build-constraint tag, new packages go/format, net/http/cookiejar and runtime/race, plus experimental support for freebsd/arm, netbsd/386/amd64/arm, openbsd/386/amd64, and cgo on linux/arm.