Go 1.21 introduces a change in the numbering of releases. The first release is now Go 1.N.0.
The release maintains Go 1 compatibility promise, expecting almost all programs to continue to compile and run as before.
min
and max
to compute smallest or largest value.clear
to delete elements from a map or zero elements of a slice.Preview of per-iteration for loop variables.
Changes in goroutine panic and recover behavior.
Formalization of GODEBUG environment variable for backward compatibility.
Strict minimum requirement for Go version in go.work
or go.mod
file.
Ability for go
command to invoke other Go toolchain versions.
Profile-guide optimization (PGO) ready for general use, with performance improvements of 2-7%.
Improved build speed by up to 6%.
log/slog
package for structured logging with levels.slices
package for common operations on slices.maps
package for common operations on maps.cmp
package for ordered type comparisons.go:wasmimport
directive for WebAssembly.