The last 2+ months I've been reorganizing vet around the new
golang.org/x/tools/go/analysis API, which enables modular static checkers to be expressed independent of any particular application, making it easy for anyone to write vet checks, build a vet-like tool from an a la carte menu of checks, and efficiently apply any vet-like tool to a code base using go vet or similar functionality in other build systems such as Bazel and Blaze, or from within other applications such as IDEs, code review tools, and batch pipelines.
This week I plan to replace cmd/vet with a copy of the driver at cmd/vendor/
golang.org/x/tools/go/analysis/cmd/vet-lite. The logic of each checker is essentially unchanged; only the driver differs. My remaining tasks are:
- bring the vet fork up to date w.r.t. the few recent changes in cmd/vet
- ensure that cmd/vet command-line documentation is accurate
- update cmd/vendor, adding a script for this and future updates.
- change cmd/vet/all to use "go vet" instead of "go tool vet",
and measure any performance impact on the builders
This requires investigating all deviations in cmd/vet/all diagnostics.
Most of the other differences result from "go vet" being more precise than "go tool vet".
- replace cmd/vet with a copy of vet-lite's short main.go file.
At that point, "go vet" will use the new driver.
Let me know if you have questions/concerns.
cheers
alan