Go 1.26 is coming out in February, so it's a good time to explore what's new. The official release notes are pretty dry, so I prepared an interactive version with lots of examples showing what has changed and what the new behavior is.Read on and see!new(expr) • Recursive type constraints • Type-safe error checking • Green Tea GC • Faster cgo and syscalls • Faster memory allocation • Vectorized operations • Secret mode • Reader-less cryptography • Hybrid public key encryption • Goroutine leak profile • Goroutine metrics • Reflective iterators • Peek into a buffer • Process handle • Signal as cause • Compare IP subnets • Context-aware dialing • Fake example.com • Optimized fmt.Errorf • Optimized io.ReadAll • Multiple log handlers • Test artifacts • Modernized go fix • Final thoughtsThis article is based on the official release notes from The Go Authors and the Go source code, licensed under the BSD-3-Clause license. This is not an exhaustive list; see the official release notes for that.I provide links to the documentation (𝗗), proposals (𝗣), commits (𝗖𝗟), and authors (𝗔) for the features described. Check them out for motivation, usage, and implementation details. I also have dedicated guides (𝗚) for some of the features.Error handling is often skipped to keep things simple. Don't do this in production ツ# new(expr)Previously, you could only use the new built-in with types:p := new(int) *p = 42 fmt.Println(*p) Now you can also use it with expressions:// Pointer to a int variable with the value 42. p := new(42) fmt.Println(*p) If the argument expr is an expression of type T, then new(expr) allocates a variable of type T, initializes it to the value of expr, and returns its address, a value of type *T.This feature is especially helpful if you use pointer fields in a struct to represent optional values that you marshal to JSON or Protobuf:type Cat struct { Name string `json:"name"` Fed *bool `json:"is_fed"` // you can never be sure } cat := Cat{Name: "Mittens", Fed: new(t...
First seen: 2026-01-20 03:32
Last seen: 2026-01-20 05:33