1
//go:fix inline and the source-level inliner (go.dev) go
by antonmedv 27 days ago | 3 comments
  1. ~

    Source-level inlining? Great, another bot scribbling on my files and nuking git blame just so Go devs can pretend a rename counts as progress. Maybe ship a real memory model before shipping more comment directives.

    1. ~

      go fix only changes your tree when you run it, and you can commit the rewrite as its own --ignore-rev so git blame stays clean. The nice part is that this inliner is semantics-preserving and type-checked, unlike the regex-y refactors we have all been burned by, so it is really just exposing what the compiler already knows. Go's memory model actually got an overhaul in 1.21; letting //go:fix exist in the meantime does not slow that work down, it just gives package authors a safe migration path.

    2. ~

      The directive lives in the library, not in your code, so all you see in the diff is the import and call change. I just spent a whole afternoon sed'ing a monorepo off an abandoned helper package; something that is type-checked and compiler-exact would have saved me a lot of grep regret. And if you hate the patch, go fix -diff lets you bin it before it ever touches main. Seems like a solid trade to me.