diff options
| author | Femaref | 2018-01-20 12:03:17 +0100 |
|---|---|---|
| committer | Femaref | 2018-01-20 12:03:17 +0100 |
| commit | aa771ab45be6e0a22fe6dd86f4f3836b2492f78d (patch) | |
| tree | e01cc26771421639c4058a1f94811ba9a28c87db | |
| parent | accb140e81998d3630825d7e236f603e43d5cf07 (diff) | |
| download | gomove-aa771ab45be6e0a22fe6dd86f4f3836b2492f78d.tar.bz2 | |
ignore the vendor path. It can't contain references to the package anyway and speeds up performance.
| -rw-r--r-- | main.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 }) |
