gosec
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. More information: https://github.com/securego/gosec.
- Scan a Go package recursively in the current directory:
gosec ./...
- Scan a specific Go package:
gosec
- Scan a Go package recursively and save results to a file:
gosec -fmt -out
- Only include a specific set of rules (by default, all rules will run):
gosec -include
- Exclude directories from scanning:
gosec -exclude-dir
- Scan with a specific severity or confidence level:
gosec -severity -confidence
- Exclude a specific set of rules from scanning:
gosec -exclude
- Scan test files as well:
gosec -tests
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
