Skip to content

Commit acc4c80

Browse files
exclusion rule fix (#34)
Exclusion rule was getting applied only to the name of the file. Made a change to get it applied for the path as well.
1 parent 20c9d91 commit acc4c80

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ func processRequest(out string, inputPath string, excludeFiles string) {
9898
return err
9999
}
100100
if !info.IsDir() && (strings.HasSuffix(info.Name(), ".go") || strings.HasSuffix(info.Name(), ".mod")) {
101-
matched, _ := regexp.MatchString(excludeFiles, info.Name())
102-
if excludeFiles == "" || matched == false {
101+
fileMatched, _ := regexp.MatchString(excludeFiles, info.Name())
102+
pathMatched, _ := regexp.MatchString(excludeFiles, path)
103+
if excludeFiles == "" || (fileMatched == false && pathMatched == false) {
103104
totalSentForProcessing++
104105
go processFile(out, inputPath, path, info, resultErrChan, sem)
105106
}

0 commit comments

Comments
 (0)