aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorFemaref2018-01-20 12:03:17 +0100
committerFemaref2018-01-20 12:03:17 +0100
commitaa771ab45be6e0a22fe6dd86f4f3836b2492f78d (patch)
treee01cc26771421639c4058a1f94811ba9a28c87db /main.go
parentaccb140e81998d3630825d7e236f603e43d5cf07 (diff)
downloadgomove-aa771ab45be6e0a22fe6dd86f4f3836b2492f78d.tar.bz2
ignore the vendor path. It can't contain references to the package anyway and speeds up performance.
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 52fe963..60d98e4 100644
--- a/main.go
+++ b/main.go
@@ -57,10 +57,15 @@ func ScanDir(dir string, from string, to string, c *cli.Context) {
if from != "" && to != "" {
// Scan directory for files
filepath.Walk(dir, func(filePath string, info os.FileInfo, err error) error {
+ // ignore vendor path
+ if matched, _ := path.Match("vendor/*", filePath); matched {
+ return nil
+ }
// Only process go files
if path.Ext(filePath) == ".go" {
ProcessFile(filePath, from, to, c)
}
+
return nil
})