Go 1.27 Adds Generic Methods and Post-Quantum Crypto

Go 1.27 is out, bringing major enhancements to the language, toolchain, runtime, and standard library. Notably, it introduces support for generic methods, allowing developers to write type-agnostic functions like the new Rand.N method. The release also includes faster memory allocation, a new goroutine leak profiler, and the experimental encoding/json/v2 package. For security, crypto/mldsa implements the post-quantum ML-DSA signature scheme, integrated into crypto/x509 and crypto/tls.
Go 1.27 brings major enhancements across the language, toolchain, runtime, and standard library.
- e4m2
Not mentioned: Floating-point parsing and formatting now uses Russ Cox's uscale algorithm.
https://github.com/golang/go/blob/go1.27.0/src/internal/strc...
- teabee89
I love how proactive the crypto team is about post quantum. They released https://pkg.go.dev/crypto/mldsa. The lead maintainer Filippo Valsorda wrote a nice piece here[1] to urge the tech world to start deploying good enough versions of post quantum crypto.
- guessmyname
Brace for a wave of drive-by pull-requests swapping google/uuid [1] out for the now-standard uuid package [2].
Kubernetes project will be the first one [3] I guarantee it.
[1] https://pkg.go.dev/github.com/google/uuid
[3] https://github.com/kubernetes/kubernetes/blob/2220c3853a2402...
- Xeoncross
> First, generic methods are now supported
> Generic functions can now be used without explicit type arguments
Great! This was an ergonomic code issue I hit when trying to create a universal handler/controller generic that could hydrate/populate function arguments (from a request body) without having an actual copy of the arguments: https://github.com/xeoncross/mid/blob/main/handler.go#L12
- xavdid
I love these release notes but I really wish they would add syntax highlighting to the Go blog. I'm always a little bit surprised/disappointed whenever I land on a go.dev link since I know the code will be just a little harder to visually parse than it needs to be.
- olingern
> Second, a key in a struct literal may now be any valid field selector for the struct type, allowing fields in nested or embedded structs to be initialized directly
It's been a while since I've written more than anything trivial in golang, but this seems like a big deal to me. As in, I can define a struct that is consistent and reusable in other structs
- piinbinary
This makes me want to find a side project for an excuse to give Go another try (I last used it professionally pre-generics).
I do still wish it had discriminated unions (algebraic data types) and some better error handling ergonomics.
- freakynit
As I've always said: every non-functional programming language, as it matures, it's adoption rises in enterprise, eventually starts to become more and more like Java in terms of it's syntax and feature-set.