← All releases

go1.26.0

Major

February 10, 2026

Go 1.26 adds two small language extensions (new(expr), self-referential generic constraints), a rewritten go fix with automated "modernizers," a default-on Green Tea GC (10-40% less GC overhead), faster cgo calls, heap-address randomization, and tighter crypto/net defaults — all compatible with existing code.

highlights
  • new() now accepts an arbitrary expression as its operand (not just a type), simplifying getting a pointer to a computed value, e.g. new(yearsSince(born)).

  • Generic type parameters may now self-reference their own type in constraints, e.g. type Adder[A Adder[A]] interface { Add(A) A }.

  • go fix has been rewritten as the home of 'modernizers': push-button fixers built on the go vet analysis framework, plus a source-level inliner driven by //go:fix inline directives; old obsolete fixers removed.

  • go mod init now writes an older go directive by default (current minor minus one, or minus two for prereleases) to favor broader compatibility.

  • Green Tea garbage collector is now enabled by default, expected to cut GC overhead roughly 10-40% (more on newer amd64 CPUs via vector instructions); disable with GOEXPERIMENT=nogreenteagc.

  • cgo call overhead reduced by about 30%, and the runtime now randomizes the heap base address on 64-bit platforms for security.

  • Experimental goroutine leak profiling added via GOEXPERIMENT=goroutineleakprofile, with a new runtime/pprof 'goroutineleak' profile and /debug/pprof/goroutineleak endpoint.

  • Compiler now stack-allocates slice backing arrays in more cases for better performance, tunable/debuggable via bisect or -gcflags.

  • New crypto/hpke package implements RFC 9180 HPKE with post-quantum hybrid KEM support; several crypto packages (dsa, ecdh, ecdsa, ed25519, rand, rsa) now ignore caller-supplied randomness and always use a secure source internally.

  • image/jpeg's encoder and decoder were replaced with new, faster, more accurate implementations, so bit-for-bit output may change.

  • net/url.Parse now rejects malformed URLs with colons in the host (opt out via GODEBUG=urlstrictcolons=0); net/http's ServeMux trailing-slash redirects now use 307 instead of 301.

  • cmd/doc and go tool doc removed (use go doc); pprof's -http web UI now defaults to flame graph view; macOS 12 support ends after this release and freebsd/riscv64 is marked broken.