gosec
Inspect Go source code for security problems. tldr-pages
On several platforms
Several platforms
Inspect Go source code for security problems. Note: ./... is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.
Scan a Go package recursively in the current directory
gosec ./...IdentifyScan a specific Go package
gosec path/to/packageIdentifyScan a Go package recursively and save results to a file
gosec -fmt json -out path/to/report ./...IdentifyOnly include a specific set of rules (by default, all rules will run)
gosec -include G101,G203,G401,... ./...IdentifyExclude directories from scanning
gosec -exclude-dir path/to/excluded_directory ./...IdentifyScan with a specific severity or confidence level
gosec -severity low -confidence low ./...IdentifyExclude a specific set of rules from scanning
gosec -exclude G101,G304,G401,... ./...IdentifyScan test files as well
gosec -tests ./...Identify