Go 1.26 Revolutionizes Code Modernization: Source-Level Inliner Now Part of 'go fix'
Breaking: Go 1.26 Launches All-New 'go fix' with Self-Service Migration Capabilities
The Go team has released a groundbreaking update to the go fix command in Go 1.26, introducing a source-level inliner that empowers package authors to automate API migrations and code upgrades safely. This marks a shift from bespoke modernization tools to a self-service model, dramatically simplifying how developers keep codebases current. The new inliner is already integrated into gopls for interactive refactoring and is now available as part of the standard toolchain.

Source-Level Inlining: A Deeper Look
First built in 2023, the source-level inliner replaces a function call with a copy of the function's body, substituting arguments for parameters. Unlike compiler inlining, which operates on ephemeral intermediate representations, this transformation permanently modifies source code.
According to Alan Donovan of the Go team, “The inliner is a crucial building block for a number of source transformation tools.” It handles subtle correctness issues such as variable shadowing, side effects, and return statements, ensuring refactored code is both correct and readable.
Background: From Bespoke Modernizers to Self-Service
Previously, go fix offered dedicated modernizers for specific language and library changes, requiring manual development for each new feature. The source-level inliner changes this by allowing any package author to express simple API migrations using straightforward rules.
Donovan explains, “It enables any package author to express simple API migrations and updates in a straightforward and safe way.” The inliner has already been used by gopls for refactorings like “Change signature” and “Remove unused parameter,” demonstrating its versatility.
How It Works in Practice
Developers can invoke the inliner via go fix or through gopls’s “Inline call” code action. For example, inlining a call to a simple sum function replaces the call with the literal addition, eliminating function overhead and clarifying intent.

The transformation respects Go’s scoping rules, renames variables to avoid collisions, and formats the result with gofmt. The result is production-ready code that is both faster to compile and easier to maintain.
What This Means for the Go Community
The introduction of the source-level inliner into go fix lowers the barrier for modernization. Package authors can now ship migration rules alongside library updates, reducing the burden on downstream consumers. This aligns with Go’s emphasis on simplicity and automation.
For enterprise teams managing large codebases, the inliner promises dramatic reductions in manual refactoring work. The Go team anticipates that future releases will extend this capability to more complex transformations.
Next Steps and Availability
Go 1.26 is available for download now. Developers are encouraged to experiment with the new go fix and the source-level inliner, especially in projects undergoing API upgrades. The Go blog offers detailed documentation, and the team welcomes feedback through the issue tracker.
For a complete overview, read the original post on the Go Blog.
Related Articles
- Go 1.26 Unveils Source-Level Inliner: Self-Service API Migrations Now Possible
- Go Team Launches 2025 Developer Survey: Feedback to Shape Future of Language
- Scaling Teams Beyond Code: Solving Human Bottlenecks in Hyper-Growth
- Python Community Establishes First-Ever Elected Packaging Council as 3.15 Alpha Boosts Performance
- IBM's Bob Platform: AI-Assisted Development with Built-In Governance and Audit Trails
- Python 3.15 Alpha 5: Inside the Latest Developer Preview
- Mastering IntelliJ IDEA: A Comprehensive Guide to Productivity and Development
- Mastering GDB: 7 Essential Facts About Source-Tracking Breakpoints