Skip to content

Commit c0db486

Browse files
author
Cosmin Cojocar
authored
Merge pull request #222 from ccojocar/vendor_folder_flag
Add a flag to turn on scanning on vendor folder
2 parents f5b44b0 + 6919d97 commit c0db486

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/gosec/main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ var (
9191
// go build tags
9292
flagBuildTags = flag.String("tags", "", "Comma separated list of build tags")
9393

94+
flagScanVendor = flag.Bool("vendor", false, "Scan the vendor folder")
95+
9496
logger *log.Logger
9597
)
9698

@@ -278,8 +280,10 @@ func main() {
278280
for _, pkg := range gotool.ImportPaths(cleanPaths(flag.Args())) {
279281

280282
// Skip vendor directory
281-
if vendor.MatchString(pkg) {
282-
continue
283+
if !*flagScanVendor {
284+
if vendor.MatchString(pkg) {
285+
continue
286+
}
283287
}
284288
packages = append(packages, resolvePackage(pkg, gopaths))
285289
}

0 commit comments

Comments
 (0)