diff options
author | Alan Donovan <adonovan@google.com> | 2018-11-02 11:27:53 -0400 |
---|---|---|
committer | Alan Donovan <adonovan@google.com> | 2018-11-19 15:20:54 +0000 |
commit | 42b46585f19a6d6b3819d025e0f4b07b18a6b5b7 (patch) | |
tree | 64af8ff9f34446024ddc85ac25900b6027a1507c /src/cmd/vet/main.go | |
parent | 3c92bdc7db3ebf062adc9287743d74e60ba5bb03 (diff) | |
download | go-42b46585f19a6d6b3819d025e0f4b07b18a6b5b7.tar.gz go-42b46585f19a6d6b3819d025e0f4b07b18a6b5b7.zip |
cmd/go: improve go vet documentation
- restore and rework cmd/vet/doc.go, which was clobbered during the vet-lite switch.
- document go vet -vettool=prog flag and how to run an alternative checker.
- make 'go vet -help' show how to list vet tool's flags. Example:
$ go vet -help
usage: go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages]
Run 'go help vet' for details.
Run 'go tool vet help' for the vet tool's flags.
$ go vet -vettool=~/bin/myvet -help
usage: go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages]
Run 'go help vet' for details.
Run '~/bin/myvet help' for the vet tool's flags.
Updates #28840
Change-Id: Ieb79dfe29e1df074f865bc9a9d47b44199675d7d
Reviewed-on: https://go-review.googlesource.com/c/147018
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Run-TryBot: Daniel Martà <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/vet/main.go')
-rw-r--r-- | src/cmd/vet/main.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go index 3ea781a7d4..4ec174b3cd 100644 --- a/src/cmd/vet/main.go +++ b/src/cmd/vet/main.go @@ -1,8 +1,3 @@ -// The vet command is a driver for static checkers conforming to -// the golang.org/x/tools/go/analysis API. Run it using 'go vet'. -// -// For a tool capable of running standalone, use a multichecker-based -// tool such as golang.org/x/tools/go/analysis/cmd/vet. package main import ( @@ -31,21 +26,6 @@ import ( "golang.org/x/tools/go/analysis/passes/unusedresult" ) -// Legacy vet had the concept of "experimental" checkers. - -// There was exactly one, shadow, and it had to be explicitly -// enabled by the -shadow flag, which would of course disable -// all the other tristate flags, requiring the -all flag (which -// is now a no-op) to reenable them. -// -// The shadow analyzer has been removed from the suite, -// but can be run using these additional commands: -// $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow -// $ go vet -vettool=$(which shadow) -// Alternatively, one could build a multichecker containing all -// the desired checks (vet's suite + shadow) and run it in a -// single "go vet" command. - func main() { unitchecker.Main( asmdecl.Analyzer, |