From 882503383d0d646c2ac25a315177187c66cd4b67 Mon Sep 17 00:00:00 2001 From: Tadas Krivickas Date: Tue, 17 Sep 2019 16:45:48 +0300 Subject: [PATCH] Exclude root from checks --- util/files.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/files.go b/util/files.go index d6a60e5..5ab6ce9 100644 --- a/util/files.go +++ b/util/files.go @@ -83,8 +83,9 @@ func GoLintExcludes() []string { func GetProjectFileDirectories(paths []string) ([]string, error) { directories := make([]string, 0) - err := filepath.Walk("./", func(path string, info os.FileInfo, err error) error { - if info.IsDir() && !IsPathExcluded(paths, path) { + root := "./" + err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if info.IsDir() && !IsPathExcluded(paths, path) && path != root { directories = append(directories, path) } return nil