mirror of
https://github.com/securego/gosec.git
synced 2025-03-01 04:33:29 +00:00
Exclude correctly the vendor folder from the scanned packages
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
parent
85eb8a52ab
commit
e419eb8f4e
1 changed files with 4 additions and 1 deletions
|
@ -250,7 +250,10 @@ func main() {
|
|||
analyzer := gosec.NewAnalyzer(config, logger)
|
||||
analyzer.LoadRules(ruleDefinitions.Builders())
|
||||
|
||||
vendor := regexp.MustCompile(`[\\/]vendor([\\/]|$)`)
|
||||
var vendor *regexp.Regexp
|
||||
if !*flagScanVendor {
|
||||
vendor = regexp.MustCompile(`([\\/])?vendor([\\/])?`)
|
||||
}
|
||||
var packages []string
|
||||
for _, path := range flag.Args() {
|
||||
pcks, err := gosec.PackagePaths(path, vendor)
|
||||
|
|
Loading…
Reference in a new issue