Skip to content

Commit

Permalink
govet: disable loopclosure with go1.22 (#4357)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Feb 8, 2024
1 parent ca7b7a4 commit b525f2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/golinters/govet.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ func analyzersFromConfig(settings *config.GovetSettings) []*analysis.Analyzer {
}

func isAnalyzerEnabled(name string, cfg *config.GovetSettings, defaultAnalyzers []*analysis.Analyzer) bool {
if name == loopclosure.Analyzer.Name && config.IsGreaterThanOrEqualGo122(cfg.Go) {
return false
}

if cfg.EnableAll {
for _, n := range cfg.Disable {
if n == name {
Expand Down

0 comments on commit b525f2b

Please sign in to comment.