24/11/2026 10:00am

What's New in Go 1.26: new(expr), Green Tea GC by Default, and the New go fix
#Go 1.26
#Golang
#Green Tea GC
#go fix
#Go release notes
When you write Go and need a struct with a pointer field because you want to tell "no value" apart from "zero value", you have probably written a temporary variable just to take its address. That extra line appears in almost every Go project.
Go 1.26 was released in February 2026 and changes this. Today Superdev Academy reads through what changed in the official release notes section by section, with code that runs, and says plainly which numbers come from the Go team itself.
new now accepts an expression
Previously new accepted only a type. Now it accepts an expression that sets the initial value of the new variable. The example below is taken from the release notes: a struct whose Age field is a pointer because the age may be unknown.
type Person struct { Name string `json:"name"` Age *int `json:"age"` // age if known; nil otherwise}func personJSON(name string, born time.Time) ([]byte, error) { return json.Marshal(Person{ Name: name, Age: new(yearsSince(born)), })}The line new(yearsSince(born)) creates an int variable holding the function's result and returns a pointer to it right away, with no intermediate variable or helper function as before.
Generic types can refer to themselves in type parameters
The old restriction that stopped a generic type from referring to itself in its own type parameter list is lifted, so you can now write constraints like this.
type Adder[A Adder[A]] interface { Add(A) A}func algo[A Adder[A]](x, y A) A { return x.Add(y)}The release notes say this makes type constraints more powerful and simplifies the spec's rules about type parameters slightly. Authors of generic libraries will feel this change more than people writing ordinary applications.
Green Tea GC is the default
The Green Tea garbage collector was experimental in Go 1.25 and is now on by default. The Go team's own wording is that results vary, but they expect garbage collection overhead to drop by roughly 10 to 40% in real programs that use the GC heavily, and by a further 10% or so on newer amd64 CPUs (Intel Ice Lake or AMD Zen 4 and later) because the GC uses vector instructions when scanning small objects.
Note that this is "expected" by the developers, not a figure guaranteed for your program. To compare, measure your existing program on Go 1.25 and 1.26 with real data. If you hit a problem you can turn it off at build time with GOEXPERIMENT=nogreenteagc, but the release notes say this option is expected to be removed in Go 1.27, so report the problem rather than relying on the opt-out long term.
go fix has been rewritten
The go fix command was rewritten on the same analysis framework as go vet and became the home of "modernizers": fixers that update your code to use newer language idioms and APIs. There is now a default set of dozens of fixers, and a source-level inliner that works from the //go:fix inline comment so library authors can migrate users from an old API to a new one automatically.
The release notes say these fixers should not change program behaviour and ask you to report any case where they do. Even so, we recommend running go fix ./... on a new branch, reading the diff and running the tests every time before you merge.
What was removed or no longer supported
All the old fixers of
go fixwere removed because they were obsolete.cmd/docandgo tool docwere removed; usego doc, which has the same flags and behaviour.The 32-bit
windows/armport was removed, as announced in Go 1.25.The ELF
.gosymtabsection was removed from the linker's output.
If your CI scripts call go tool doc, change them to go doc before you upgrade.
Try it in 10 minutes
Install Go 1.26 and create a scratch project. Add a struct with a pointer field like the one above, try writing new(expression), then run go vet ./... and go test ./.... After that, run go fix ./... in an older project that has good test coverage and look at the diff to see what was adjusted. That shows you this release more clearly than reading alone.
Summary: Go 1.26 changes the language, the runtime and the tools
Go 1.26 lets new take an expression, lets generic types refer to themselves, turns on Green Tea GC by default and rewrites go fix. The 10 to 40% GC figure is an expectation from the Go team that you need to measure against your own program. Before upgrading, check for scripts that use go tool doc, and rerun your tests after changing versions.
If you are not yet comfortable with Go's basic syntax, see the Go Cheat Sheet course from Superdev Academy: 48 minutes with 12 months of access. The course does not cover the features of Go 1.26. See all courses at learn.superdevacademy.com/courses.
🎯 Follow dev knowledge from Superdev Academy:
🔵 Facebook: Superdev Academy Thailand
🎬 YouTube: Superdev Academy Channel
📸 Instagram: @superdevacademy
🎬 TikTok: @superdevacademy
FAQ: Frequently Asked Questions about This Article
A collection of questions and answers to help you better understand the content of this article.