diff --git a/go/analysis/cmd/analyze/README b/go/analysis/cmd/vet/README similarity index 100% rename from go/analysis/cmd/analyze/README rename to go/analysis/cmd/vet/README diff --git a/go/analysis/cmd/analyze/analyze.go b/go/analysis/cmd/vet/vet.go similarity index 91% rename from go/analysis/cmd/analyze/analyze.go rename to go/analysis/cmd/vet/vet.go index b77bbbd7..ed075c43 100644 --- a/go/analysis/cmd/analyze/analyze.go +++ b/go/analysis/cmd/vet/vet.go @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The analyze command is a static checker for Go programs, similar to -// vet, but with pluggable analyzers defined using the analysis -// interface, and using the go/packages API to load packages in any +// The vet command is a static checker for Go programs. It has pluggable +// analyzers defined using the golang.org/x/tools/go/analysis API, and +// using the golang.org/x/tools/go/packages API to load packages in any // build system. // // Each analysis flag name is preceded by the analysis name: --analysis.flag. diff --git a/go/analysis/doc.go b/go/analysis/doc.go index 7ea78079..4223ab80 100644 --- a/go/analysis/doc.go +++ b/go/analysis/doc.go @@ -72,15 +72,15 @@ To add a new Analyzer to an existing driver, add another item to the list: A driver may use the name, flags, and documentation to provide on-line help that describes the analyses its performs. -The "analyze" command, shown below, is an example of a driver that runs +The vet command, shown below, is an example of a driver that runs multiple analyzers. It is based on the multichecker package (see the "Standalone commands" section for details). - $ go build golang.org/x/tools/cmd/analyze - $ ./analyze help - Analyze is a tool for static analysis of Go programs. + $ go build golang.org/x/tools/cmd/vet + $ ./vet help + vet is a tool for static analysis of Go programs. - Usage: analyze [-flag] [package] + Usage: vet [-flag] [package] Registered analyzers: @@ -90,7 +90,7 @@ multiple analyzers. It is based on the multichecker package ... unusedresult check for unused results of calls to some functions - $ ./analyze help unusedresult + $ ./vet help unusedresult unusedresult: check for unused results of calls to some functions Analyzer flags: diff --git a/go/analysis/multichecker/multichecker.go b/go/analysis/multichecker/multichecker.go index a849031e..36e5f825 100644 --- a/go/analysis/multichecker/multichecker.go +++ b/go/analysis/multichecker/multichecker.go @@ -54,8 +54,9 @@ func Main(analyzers ...*analysis.Analyzer) { args := flag.Args() if len(args) == 0 { fmt.Fprintln(os.Stderr, strings.ReplaceAll(usage, "PROGNAME", progname)) - fmt.Fprintf(os.Stderr, `Run '%[1]s help' for more detail, - or '%[1]s help name' for details and flags of a specific analyzer.\n`, progname) + fmt.Fprintf(os.Stderr, "Run '%[1]s help' for more detail,\n"+ + " or '%[1]s help name' for details and flags of a specific analyzer.\n", + progname) os.Exit(1) }