diff --git a/utils.go b/utils.go index 8d6ac7f..a972c41 100644 --- a/utils.go +++ b/utils.go @@ -43,7 +43,7 @@ type GitIgnore struct { // NewGitIgnore creates a new GitIgnore parser by reading .gitignore file func NewGitIgnore() (*GitIgnore, error) { gi := &GitIgnore{} - + file, err := os.Open(".gitignore") if err != nil { if os.IsNotExist(err) { @@ -104,7 +104,7 @@ func (gi *GitIgnore) matchPattern(pattern, path string) bool { // Check if pattern matches any suffix of the path pathParts := strings.Split(path, string(filepath.Separator)) patternParts := strings.Split(pattern, "/") - + if len(patternParts) <= len(pathParts) { for i := 0; i <= len(pathParts)-len(patternParts); i++ { match := true