← All releases

go1.0.0

Major

March 28, 2012

Go 1 locks in a long-term compatibility promise but breaks pre-1.0 code with substantial language and library cleanups (new error type, redesigned time package, rune type, delete(), reorganized packages); go fix automates most of the migration, and a new go command and packaged binaries debut.

highlights
  • Go 1 establishes a compatibility promise: code that compiles under Go 1 is expected to keep compiling and running unchanged through future 1.x releases

  • New go command introduced for fetching, building, and installing packages, replacing the old makefile-based build system

  • New built-in error interface type and errors package (errors.New) replace os.Error and os.NewError across the standard library

  • time package completely redesigned with distinct Time and Duration types (nanosecond resolution) replacing raw int64 nanosecond counts

  • New rune type (alias for int32) introduced for Unicode code points, distinct from int, enabling int to eventually be 64-bit on 64-bit platforms

  • New delete(m, k) builtin replaces the old m[k] = value, false idiom for removing map entries

  • Iteration order over maps with for range is now explicitly defined as unpredictable, even across repeated runs

  • Structs and arrays can now be compared with == and used as map keys; equality on function and map values (except nil) was removed

  • append() can now append a string directly onto a []byte without an explicit conversion

  • close() on a receive-only channel is now a compile-time error

  • Standard library reorganized into subdirectories (e.g. http to net/http, json to encoding/json) with many packages moved to subrepositories, exp, or old; go fix automates most import and API updates

  • Prepackaged, downloadable binary distributions are now available for multiple OS/architecture combinations including Windows