Skip to content

Commit

Permalink
Merge pull request #4 from alingse/add-simple-test
Browse files Browse the repository at this point in the history
clean code && add test
  • Loading branch information
alingse authored Jul 7, 2022
2 parents 0a7051f + 77abffe commit 47433b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion asasalint.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func NewAnalyzer(excludes []string, include []string) *analysis.Analyzer {
a.excludes[exclude] = true
}
for _, exclude := range excludes {
a.excludes[exclude] = true
if exclude != "" {
a.excludes[exclude] = true
}
}

for _, include := range include {
Expand Down
5 changes: 5 additions & 0 deletions asasalint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ func (a *A) hello2(a int, b int) {
return true
})
}

func TestNewAnalyzer(t *testing.T) {
_ = NewAnalyzer(nil, nil)
_ = NewAnalyzer([]string{"hello", ""}, []string{"hello", "world"})
}

0 comments on commit 47433b8

Please sign in to comment.