Go 1.0 was released in March 2012, and a new major release has followed about every six months since. Go 1.27 is the current release. Language changes are listed below, from the release notes and the Language versions appendix of the specification.
The Go 1 compatibility promise
Programs written to the Go 1 specification are intended to keep compiling and running
correctly, unchanged, over the lifetime of that specification. The promise has stated
exceptions: security problems, unspecified behaviour, specification errors, compiler or library
bugs, unkeyed struct literals of imported types, method additions that conflict with an
embedded type, dot imports that gain a conflicting name, and code using unsafe. A
program’s language version is the version it was written for, so old code keeps its old
meaning.
How the language version is chosen
In a module, the go
directive sets the language version for its packages. A
//go:build line with
a go1.N term can lower the version for one file, in modules at Go 1.21 or later.
The compiler rejects features newer than the language version in force: a file containing
0b1011 is rejected below Go 1.13.
Language changes that alter behaviour, such as per-iteration loop variables in Go 1.22, apply according to the language version, so an older module keeps its previous behaviour.
Releases
| Release | Date | Language changes |
|---|---|---|
| Go 1.0 | 28 March 2012 | The first stable release, and the base of the compatibility promise |
| Go 1.1 | 13 May 2013 | Method values. Terminating statements relax the final-return rule. Integer division by constant zero is a compile error. Surrogate halves are excluded from string and rune literals |
| Go 1.2 | 1 December 2013 | Three-index slices. Use of nil pointers is guaranteed to trigger a run-time panic |
| Go 1.3 | 18 June 2014 | None. The memory model gained a rule on buffered channels |
| Go 1.4 | 10 December 2014 | for range x without variables. Method calls on **T disallowed |
| Go 1.5 | 19 August 2015 | Element type elision applies to map keys in composite literals |
| Go 1.6 | 17 February 2016 | None |
| Go 1.7 | 15 August 2016 | Terminating statements consider the final non-empty statement |
| Go 1.8 | 16 February 2017 | Struct tags ignored in conversions. The specification requires only 16-bit exponents in floating-point constants |
| Go 1.9 | 24 August 2017 | Type aliases. Rules for fused floating-point operations |
| Go 1.10 | 16 February 2018 | Clarifications: shifts of untyped constants allow x[1.0 << s], and method expressions accept any type expression as a receiver |
| Go 1.11 | 24 August 2018 | None. Modules arrive as a preliminary feature |
| Go 1.12 | 25 February 2019 | None |
| Go 1.13 | 3 September 2019 | Number literal prefixes 0b and 0o, hexadecimal floats, i suffix on any literal, digit separators. Signed shift counts |
| Go 1.14 | 25 February 2020 | Embedded interfaces may overlap, with identical signatures |
| Go 1.15 | 11 August 2020 | None |
| Go 1.16 | 16 February 2021 | None. //go:embed arrives through the go command |
| Go 1.17 | 16 August 2021 | Slice to array pointer conversions. unsafe.Add and unsafe.Slice |
| Go 1.18 | 15 March 2022 | Generics: type parameters, constraints, the ~ token. Predeclared any and comparable |
| Go 1.19 | 2 August 2022 | A correction to the scope of type parameters in method declarations. The memory model was revised |
| Go 1.20 | 1 February 2023 | Slice to array conversions. unsafe.SliceData, String and StringData. Field and element comparison order defined. Comparable types satisfy comparable |
| Go 1.21 | 8 August 2023 | min, max and clear. Package initialisation order made exact. More powerful type inference. panic(nil) becomes a run-time panic |
| Go 1.22 | 6 February 2024 | Per-iteration for loop variables. Range over integers |
| Go 1.23 | 13 August 2024 | Range over iterator functions |
| Go 1.24 | 11 February 2025 | Generic type aliases |
| Go 1.25 | 12 August 2025 | None affecting programs. The specification dropped the notion of core types in favour of dedicated prose |
| Go 1.26 | 10 February 2026 | new accepts an expression. A generic type may refer to itself in its type parameter list |
| Go 1.27 | 19 August 2026 | Generic methods. Struct literal keys may be any valid field selector. Function type inference applies wherever a generic function is assigned or converted to a function type |
Notes on changes that affect old code
- Go 1.22 loop variables. Each iteration has its own variables. Code that depended on sharing between iterations, usually a bug, behaves differently once its module moves to a language version of 1.22 or later.
- Go 1.21 and
panic(nil).panicwith a nil value now panics with*runtime.PanicNilError. A program whose main package is in a module declaringgo 1.20or earlier keeps the old behaviour, becauseGODEBUG=panicnil=1is then set automatically. - Go 1.21 and
golines. Thegoline became a strict minimum, and thegocommand can fetch a newer toolchain when required. - Go 1.18 fixes. Variables set inside a function literal but never used are now rejected as unused.