go-vet(1)

go-vet1

Report likely mistakes in packages

Usage

go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages]

Overview

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-packages(7).
For a list of checkers and their flags, see 'go tool vet help'.
For details of a specific checker such as 'printf', see 'go tool vet help printf'.

Options

-n

The -n flag prints commands that would be executed.

-x

The -x flag prints commands as they are executed.

-vettool=prog

The -vettool=prog flag selects a different analysis tool with alternative or additional checks.
For example, the 'shadow' analyzer can be built and run using these commands:

  go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
  go vet -vettool=$(which shadow)

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'.

Releases

7 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–11
  2. 12–13

-vettool since Debian 12 (Bookworm).

Author

This manual page was written by Michael Stapelberg <[email protected]> and is maintained by the Debian Go Compiler Team <[email protected]> based on the output of 'go help vet' for the Debian project (and may be used by others).

From gccgo-go 2:1.24~2 in Debian 13 (Trixie). Also shipped by golang-go. Parsed by carta from the page's man source.