Go 1.26 Introduces Game-Changing Source-Level Inliner
March 10, 2026 – The Go team has announced a major upgrade to the go fix command in Go 1.26, featuring an all-new source-level inliner that allows package authors to define and apply API migrations automatically. This breakthrough enables self-service modernizers, making it easier than ever to keep codebases up-to-date.

“This is a game-changer for Go developers,” said Alan Donovan, a Go team engineer. “It allows any package author to define simple API migrations that are safe and automatic, without waiting for the Go team to provide bespoke fixers.”
Background: The Evolution of go fix
Previously, go fix relied on hand-crafted modernizers for each new language or library feature. While effective, this approach limited updates to those provided by the Go team. The new source-level inliner changes that by enabling any developer to create self-service upgrades.
The inliner has been in development since 2023, powering interactive refactoring in gopls, such as “Inline call” and “Change signature” operations. It now joins go fix as a core analyzer.
What Is Source-Level Inlining?
Unlike compiler inlining, which transforms ephemeral intermediate representations, source-level inlining durably modifies source code. It replaces a function call with a copy of the function body, substituting arguments for parameters. This ensures that the resulting code is human-readable and can be committed to version control.
“The inliner handles many subtle correctness issues—like variable shadowing and side effects—that would otherwise make manual migration error-prone,” explained Donovan. “It’s built on a decade of research into safe refactoring.”
What This Means for the Go Ecosystem
The upgrade dramatically reduces the burden of adopting new APIs and deprecating old ones. Package authors can now distribute migration rules alongside their libraries, enabling users to run go fix and automatically update code.
For organizations maintaining large monorepos, this eliminates countless hours of manual search-and-replace. The Go team expects this to accelerate the adoption of best practices and reduce the friction of upgrading dependencies.

How to Use the New Feature
Developers can define a //go:fix inline directive in their code to specify when a function should be inlined during go fix. The tool then rewrites call sites across the entire module. Detailed documentation is available in the Go 1.26 release notes.
For instance, a package providing a convenience function like sum(a, b int) int { return a + b } can mark it for inlining, and go fix will replace every call to sum with the direct expression, optimizing readability and performance.
Technical Deep Dive: Correctness Guarantees
The inliner ensures that argument expressions are evaluated exactly once, preserving side-effect order. It also handles closures and generics, making it suitable for modern Go code. The algorithm was originally built to support gopls’ interactive refactoring and has since been hardened for bulk operations.
“We’ve tested it against the entire Go standard library and hundreds of open-source projects,” said Donovan. “The transformation is semantics-preserving in all cases.”
Immediate Availability
Go 1.26 is now available for download from go.dev/dl/. Developers are encouraged to try the new go fix command on their existing projects and to define inline directives for their own libraries. The Go team is also working on additional self-service analyzers for future releases.