From aa771ab45be6e0a22fe6dd86f4f3836b2492f78d Mon Sep 17 00:00:00 2001 From: Femaref Date: Sat, 20 Jan 2018 12:03:17 +0100 Subject: ignore the vendor path. It can't contain references to the package anyway and speeds up performance. --- main.go | 5 +++++ 1 file changed, 5 insertions(+) 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 }) -- cgit v1.2.3