1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:38:32 -06:00
Commit Graph

3 Commits

Author SHA1 Message Date
David Symonds
f895b43688 vet: Rearrange checkers to use a registration system.
This removes much of the AST logic out of main.go,
and makes it easier to build custom vet binaries

The trade-off in this change is for flexibility.
There's very little change in the per-check files,
a lot less code in main.go (specifically the AST walking
logic has shrunk), and it makes it much easier to build
custom vet binaries simply by dropping new source files
in the directory.

LGTM=josharian, r
R=r, josharian, kamil.kisiel
CC=golang-codereviews
https://golang.org/cl/83400043
2014-06-13 15:04:45 +10:00
Rob Pike
95c9b7bad1 go.tools/cmd/vet: replace warnings by errors
Over time, a number of modules were added that used Warn instead of Bad
to report problems with the code, but the documentation states that
if there is a problem, the exit code must be 1, not 0. Warn does not set the
exit code and should be used only for internal errors and messages
triggered by the -v flag.

There's nothing substantive here except calling the other function in a few
places.

Fixes golang/go#7017.

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/71860044
2014-03-07 15:31:28 +11:00
Rob Pike
01f8cd246d go.tools: add go/types, ssa, and cmd/vet
They will be deleted from their current homes once this has landed.
Changes made to import paths to make the code compile, and to find
errchk in the right place in cmd/vet's Makefile.
TODO in a later CL: tidy up vet.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9495043
2013-05-17 13:20:39 -07:00