go-vet
Static analysis for Go source code
TLDR
Check current package
$ go vet
Check specific package$ go vet [package]
Check all packages$ go vet ./...
Run specific analyzer$ go vet -[analyzer] [package]
List analyzers$ go vet -help
SYNOPSIS
go vet [options] [packages]
DESCRIPTION
go vet examines Go source code and reports suspicious constructs that the compiler does not catch. It finds bugs like incorrect printf format strings, unreachable code, and misuse of sync primitives.
The tool runs multiple analyzers that check for common mistakes. It is part of the standard quality assurance workflow alongside testing and formatting.
PARAMETERS
PACKAGES
Packages to check.-json
JSON output.-c N
Number of errors to show.--help
Display help information.
CAVEATS
Not exhaustive. False positives possible. Use with tests and code review.
HISTORY
go vet is part of the Go toolchain, providing static analysis for catching common programming errors.
SEE ALSO
go(1), staticcheck(1), golint(1)
