//go:fix inline Directive: Go's New Source-Level Inliner for Automated API Migrations

The Go team has published a blog post introducing the //go:fix inline compiler directive and the associated gofix source-level inliner tool, which allows deprecated or refactored API wrappers to be automatically rewritten at call sites across a codebase. Package authors can annotate wrapper functions with the directive so that go fix will transparently migrate callers to the new API without manual edits, reducing friction for library evolution in large Go projects. The feature is part of Go's ongoing toolchain automation roadmap and is expected to ship in an upcoming Go release.

Key Takeaways

  • New //go:fix inline directive marks deprecated wrapper functions for automatic source-level rewriting by go fix
  • Enables library authors to ship breaking API changes that callers automatically adopt via tooling
  • Blog post published at go.dev/blog/inliner on March 11, 2026; received 94 HN points in first day

Original source: Go Team Blog