Skip to content

cmd/vet: restore documentation about vet flags #28840

Closed
@ianlancetaylor

Description

@ianlancetaylor

The rearrangement of the vet tool, while a great step forward, seems to have lost the documentation of vet flags.

> go vet -help
usage: go vet [-n] [-x] [build flags] [vet flags] [packages]
Run 'go help vet' for details.

> go help vet
usage: go vet [-n] [-x] [build flags] [vet flags] [packages]

Vet runs the Go vet command on the packages named by the import paths.

For more about vet and its flags, see 'go doc cmd/vet'.
For more about specifying packages, see 'go help packages'.

The -n flag prints commands that would be executed.
The -x flag prints commands as they are executed.

The build flags supported by go vet are those that control package resolution
and execution, such as -n, -x, -v, -tags, and -toolexec.
For more about these flags, see 'go help build'.

See also: go fmt, go fix.

> go doc cmd/vet
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.

> go tool vet -help
vet is a tool for static analysis of Go programs.

Usage of vet:
	vet unit.cfg	# execute analysis specified by config file
	vet help		# general help
	vet help name	# help on specific analyzer and its flags

go tool vet help does list available flags. But that didn't work in 1.11. And I only got there by knowing about go tool vet, which is not mentioned by any of the first places to look.

CC @alandonovan

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions