OS Manuals

/usr/bin/staticcheck

The advanced Go linter (static analysis tool)

From staticcheck 2026.2.2-r3 (enterprise-packages), captured 2026-11-08 by running staticcheck --help (exit 0). permalink

Also provided by 1 other package version
Usage: staticcheck [flags] [packages]

Flags:
  -checks checks
    	Comma-separated list of checks to enable. (default "inherit")
  -explain check
    	Print description of check
  -f format
    	Output format (valid choices are 'stylish', 'text' and 'json') (default text)
  -fail checks
    	Comma-separated list of checks that can cause a non-zero exit status. (default "all")
  -go version
    	Target Go version in the format '1.x', or the literal 'module' to use the module's Go version (default "module")
  -list-checks
    	List all available checks
  -matrix
    	Read a build config matrix from stdin
  -merge
    	Merge results of multiple Staticcheck runs
  -show-ignored
    	Don't filter ignored diagnostics
  -tags build tags
    	List of build tags
  -tests
    	Include tests (default true)
  -version
    	Print version and exit

For help about specifying packages, see 'go help packages'
Options (11)
OptionDescriptionSource
-checks checksComma-separated list of checks to enable.help
-explain checkPrint description of checkhelp
-f formatOutput format (valid choices are 'stylish', 'text' and 'json') (default text)help
-fail checksComma-separated list of checks that can cause a non-zero exit status.help
-go versionTarget Go version in the format '1.x', or the literal 'module' to use the module's Go version (default "module")help
-list-checksList all available checkshelp
-matrixRead a build config matrix from stdinhelp
-mergeMerge results of multiple Staticcheck runshelp
-show-ignoredDon't filter ignored diagnosticshelp
-testsInclude tests (default true)help
-versionPrint version and exithelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.