Skip to content

Commit

Permalink
govet: skip internal analyzers (#763)
Browse files Browse the repository at this point in the history
Some analyzers are not intended for direct usage and are
just build blocks for other analyzers.
Seems like we can distinguish them by ResultType nillness.
  • Loading branch information
ernado authored and jirfag committed Sep 30, 2019
1 parent 605c9c2 commit fe494af
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/golinters/govet.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import (
)

func getAllAnalyzers() []*analysis.Analyzer {
return []*analysis.Analyzer{
var analyzers []*analysis.Analyzer
for _, a := range []*analysis.Analyzer{
asmdecl.Analyzer,
assign.Analyzer,
atomic.Analyzer,
Expand Down Expand Up @@ -76,7 +77,14 @@ func getAllAnalyzers() []*analysis.Analyzer {
unreachable.Analyzer,
unsafeptr.Analyzer,
unusedresult.Analyzer,
} {
if a.ResultType != nil {
// Skipping internal analyzers.
continue
}
analyzers = append(analyzers, a)
}
return analyzers
}

func getDefaultAnalyzers() []*analysis.Analyzer {
Expand Down

0 comments on commit fe494af

Please sign in to comment.