Skip to content

v4.2.0 — go fix joins the gates

Choose a tag to compare

@andygeiss andygeiss released this 27 Aug 08:32
· 59 commits to main since this release

go fix is a gate and a mutator, the way gofmt and goimports already were.

  • go fix -diff ./... is the third line of check (red while a rewrite to current idiom is pending); go fix ./... is the last line of fmt, after goimports, because it type-checks and manages its own imports.
  • The fixers ship with the toolchain, so the pin decides what the gate demands: 1.26.0–1.26.7 register the same 22, 1.27.0 registers 26. A newer Go on the machine can turn the gate red on idioms the pin never asked for — prefix GOTOOLCHAIN. A moved major means make fmt first, its rewrite as its own commit.
  • A fix you judge wrong is switched off by name, -<fixer>=false, on both lines, in the commit that says why.
  • stack/go.md loses the any rule (the fixer enforces it) and gains errors.AsType in the errors row; three fences the tool would rewrite are rewritten (WaitGroup.Go, errors.AsType).
  • Reference synced and tagged v4.2.0: verify.sh 77 gates, make ci green under Go 1.26.7. The gate was red on the tree it inherited — which is the finding.

Seven review rounds, two lenses each, twenty-seven distinct defects, the last two rounds clean. The record is in VERIFICATION.md.