1min.

1MIN · GO

Go’s source inliner lets library authors encode API migrations

Go 1.26’s source inliner can replace a call with the body of a wrapper function in the caller’s source code. Library authors can mark an old API with a go:fix inline directive and express its replacement in ordinary Go. This lets go fix migrate callers, including imports, rather than leaving each downstream project to translate deprecation advice manually.

Go Project · Mar 10, 2026

Why it matters

A deeper guide for Go library maintainers, beyond the go fix introduction already covered.

More context

This is older technical reading from March. Try a small deprecated wrapper using Go 1.26 and inspect the proposed diff before accepting it. Source rewriting is distinct from compiler inlining, which optimizes generated code without editing your files.

Keep in mind

Not every breaking change can be represented safely as an inline wrapper. Behavior that inspects the call stack needs special care; 1min has not tested migrations in your codebase.

Original read

More engineering ideas, one minute at a time.

Explore more stories