Merge pull request #222 from ccojocar/vendor_folder_flag

Add a flag to turn on scanning on vendor folder
This commit is contained in:
Cosmin Cojocar 2018-07-30 09:23:52 +02:00 committed by GitHub
commit c0db486820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,9 +280,11 @@ func main() {
for _, pkg := range gotool.ImportPaths(cleanPaths(flag.Args())) {
// Skip vendor directory
if !*flagScanVendor {
if vendor.MatchString(pkg) {
continue
}
}
packages = append(packages, resolvePackage(pkg, gopaths))
}