go vet

The go subcommand that looks for code that compiles but is probably wrong, such as a print format verb that does not match its argument.

In more detail

The compiler only rejects code that breaks the language rules; vet catches suspicious patterns the compiler allows. A classic example is printing a string with %d, which compiles but prints garbage. Run it in the pipeline next to the tests.

Example

go vet ./...

Related terms

Taught in

References