Skip to content

Commit

Permalink
Merge pull request #18 from alingse/add-t-for-test
Browse files Browse the repository at this point in the history
add more support for testing
  • Loading branch information
alingse authored Jul 22, 2022
2 parents 9fb8e3d + 243d349 commit 4f05c9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion asasalint.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"golang.org/x/tools/go/ast/inspector"
)

const BuiltinExclusions = `^(fmt|log|logger)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug)(|f|ln)$`
const BuiltinExclusions = `^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$`

type LinterSetting struct {
Exclude []string
Expand Down
12 changes: 12 additions & 0 deletions testdata/src/basic/std_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ func TestStd(t *testing.T) {
log.Panicf("%v", a)
log.Panic(a)
}

func TestTest(t *testing.T) {
var a = []any{1, 2, 3}
if len(a) != 3 {
t.Log(a)
t.Logf("%v", a)
t.Error(a)
t.Errorf("%v", a)
t.Fatal(a)
t.Fatalf("%v", a)
}
}

0 comments on commit 4f05c9f

Please sign in to comment.