fix: skip go.mod report inside autogenerated_exclude processor (#4663)

This commit is contained in:
Ludovic Fernandez 2024-04-21 13:58:59 +02:00 committed by GitHub
parent 8fb9856ea9
commit 2b2fc8c966
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"go/parser" "go/parser"
"go/token" "go/token"
"path/filepath"
"regexp" "regexp"
"strings" "strings"
@ -57,6 +58,10 @@ func (p *AutogeneratedExclude) shouldPassIssue(issue *result.Issue) (bool, error
return true, nil return true, nil
} }
if filepath.Base(issue.FilePath()) == "go.mod" {
return true, nil
}
// The file is already known. // The file is already known.
fs := p.fileSummaryCache[issue.FilePath()] fs := p.fileSummaryCache[issue.FilePath()]
if fs != nil { if fs != nil {