mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
Merge pull request #222 from ccojocar/vendor_folder_flag
Add a flag to turn on scanning on vendor folder
This commit is contained in:
commit
c0db486820
1 changed files with 6 additions and 2 deletions
|
@ -91,6 +91,8 @@ var (
|
|||
// go build tags
|
||||
flagBuildTags = flag.String("tags", "", "Comma separated list of build tags")
|
||||
|
||||
flagScanVendor = flag.Bool("vendor", false, "Scan the vendor folder")
|
||||
|
||||
logger *log.Logger
|
||||
)
|
||||
|
||||
|
@ -278,8 +280,10 @@ func main() {
|
|||
for _, pkg := range gotool.ImportPaths(cleanPaths(flag.Args())) {
|
||||
|
||||
// Skip vendor directory
|
||||
if vendor.MatchString(pkg) {
|
||||
continue
|
||||
if !*flagScanVendor {
|
||||
if vendor.MatchString(pkg) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
packages = append(packages, resolvePackage(pkg, gopaths))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue