Radar · Go · Archive · Week 21 · May 18 – 24, 2026
x/tools/go/analysis/vet: export cmd/vet and cmd/fix analyzer suites
Worth knowingtooling
- What changed
- The vet and fix commands now expose their analyzer suites through new packages
x/tools/go/analysis/vetandx/tools/go/analysis/fix. - Production impact
- The source does not say.
- Try it
- Import
golang.org/x/tools/go/analysis/vetand inspectvet.Suiteto see the analyzers used bygo vet. - Source
- github.com/golang/go/issues/35487
Understand it, then run it
The go vet command runs a set of static‑analysis checks on Go code. Before Go 1.27 those checks were only defined inside the go vet binary, so a developer who wanted to reuse them had to copy the list of checks from the source. Starting with Go 1.27 the list of checks that go vet runs is exported in a new package, x/tools/go/analysis/vet. The package declares a variable called Suite that holds the slice of *analysis.Analyzer values used by go vet. A similar export exists for the go fix command in x/tools/go/analysis/fix.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed