
Go 1.27 released with generic methods, JSON v2 and post-quantum crypto
The Go team shipped Go 1.27 with generic methods, broader function type inference, faster small allocations, the encoding/json/v2 package and ML-DSA post-quantum signatures in the standard library.
Three language changes
Go 1.27 adds support for generic methods. The release notes use the Rand type in math/rand/v2 as an example: instead of separate Int32N, Int64N and IntN methods for each integer type, the type now has a single generic method, N[Int intType](n Int) Int.
Second, a key in a struct literal may now be any valid field selector for the struct type, so fields in nested or embedded structs can be initialized directly — for example setting the Burrow field of an embedded Habitat inside a Gopher literal.
Third, function type inference was generalized to apply in all assignment contexts, so generic functions can be used without explicit type arguments in composite literals, type conversions and channel sends.
Tooling, allocation and profiling
go fix gains four new modernizers — atomictypes, embedlit, slicesbackward and unsafefuncs. go doc now accepts package@version queries such as go doc example.com/[email protected], and go mod tidy automatically consolidates multiple require blocks in go.mod into the standard two-block direct and indirect layout.
In the runtime, size-specialized memory allocation cuts the cost of allocating small objects below 80 bytes by up to 30 percent, which the Go team says improves overall performance by around 1 percent in allocation-heavy programs. The goroutineleak profile in runtime/pprof is now generally available, letting programs detect goroutines that are permanently blocked.
Standard library: JSON v2, post-quantum signatures, UUID, SIMD
The new encoding/json/v2 package offers high-level JSON processing with configurable options and stricter defaults, while encoding/json/jsontext covers low-level streaming. The existing encoding/json package is now backed by the v2 implementation for faster unmarshaling and keeps backwards compatibility.
crypto/mldsa implements the post-quantum ML-DSA signature scheme specified in FIPS 204, integrated into crypto/x509 and crypto/tls. A new uuid package adds native UUID generation and parsing, simd and simd/archsimd bring experimental SIMD support, and net/http/httptest gains NewTestServer, an in-memory fake network intended for use with testing/synctest.
Where to get it
Binary archives and installers are available from the Go download page, and the full list of changes is in the release notes for Go 1.27. The team says follow-up posts will cover some of the topics in more detail over the coming weeks.
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.