Go 1.26 Unleashes Source-Level Inliner: A Game-Changer for Automated Code Modernization

Breaking: Go 1.26 Ships with Revolutionary Source-Level Inliner

March 10, 2026 — The Go team has officially released Go 1.26, featuring a completely redesigned go fix subcommand. Its standout capability: a source-level inliner that allows any package author to define and apply simple API migrations safely and automatically. This marks the first "self-service" modernizer in Go's toolkit.

Go 1.26 Unleashes Source-Level Inliner: A Game-Changer for Automated Code Modernization
Source: blog.golang.org

“The source-level inliner is a crucial building block for many source transformation tools,” said Alan Donovan, Go team member and author of the feature. “It takes care of subtle correctness issues that arise when refactoring function calls.”

The inliner replaces a function call with the body of the called function, substituting arguments for parameters—directly in the source code. Unlike traditional compiler inliners that work on ephemeral intermediate representations, this transformation is durable and user-visible.

Availability in go fix and gopls

Developers can invoke the source-level inliner via the new go fix command or through gopls’ “Inline call” interactive refactoring (found in VS Code under “Source Action…”). The feature is already powering other refactorings like “Change signature” and “Remove unused parameter.”

“The inliner ensures correctness even in complex cases, such as handling side effects, variable shadowing, and order of evaluation,” noted a Go community contributor. “It’s a huge step toward automated, safe code evolution.”

Background: From Compiler Inlining to Source-Level Automation

Inlining has long been a compiler optimization—improving performance by copying a function’s body into the caller. Go’s compiler, like many others, applies this transformation to an internal intermediate representation, then discards it after compilation.

In 2023, the Go team built a source-level inliner: an algorithm that durably modifies the actual source code. This enables tools like go fix to modernize codebases without manual effort. Previously, migrating from an old API to a new one required tedious, error-prone hand-editing or custom scripts.

“The vision is self-service modernizers,” said Donovan. “Package authors can now express simple API migrations declaratively, and go fix will apply them safely across entire codebases.”

Go 1.26 Unleashes Source-Level Inliner: A Game-Changer for Automated Code Modernization
Source: blog.golang.org

What This Means for Go Developers

The source-level inliner dramatically lowers the barrier to keeping Go code up-to-date. Instead of waiting for the Go team to write bespoke modernizers for every new language or library feature, package maintainers can now define their own migrations.

Initial tests show the inliner works seamlessly with go fix’s other analyzers. Developers using VS Code or other gopls-backed editors will get instant inline previews of refactoring changes.

“This is a foundational piece for Go’s tooling future,” a gopls engineer stated. “We can now build more ambitious refactoring tools on top of a reliable, correctness-preserving engine.”

How to Get Started

Go 1.26 is available now at golang.org/dl. To try the source-level inliner, run go fix on an existing project. For interactive use, open a Go file in VS Code and invoke the “Source Action…” menu to see inline call options.

The official Go blog post provides detailed examples and technical deep dives. The team encourages community feedback and contributions for additional modernizers.

— Reporting by The Go News Desk

Tags:

Recommended

Discover More

Amazon Expands Price History Feature to Full Year Ahead of Prime Day and Antitrust ScrutinyGitHub Copilot Individual Plans: New Limits, Model Changes, and Sign-Up Pause ExplainedKubernetes v1.36 Memory QoS: Smarter Memory Protection for Your Pods6 Key Lessons from AI Coding Mastery: What Every Developer Must Know10 Key Insights Into Fedora’s New Sealed Atomic Desktop Bootable Container Images