File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
test/testdata/zerologlint Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ require (
6
6
github.com/mattn/go-colorable v0.1.12 // indirect
7
7
github.com/mattn/go-isatty v0.0.14 // indirect
8
8
github.com/rs/zerolog v1.29.0 // indirect
9
- golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
9
+ golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
10
+ golang.org/x/sys v0.1.0 // indirect
10
11
)
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ import (
6
6
7
7
"github.com/rs/zerolog"
8
8
"github.com/rs/zerolog/log"
9
+ "golang.org/x/exp/slices"
9
10
)
10
11
11
- func bad () {
12
+ func expectWarnings () {
12
13
log .Error () // want "must be dispatched by Msg or Send method"
13
14
log .Info () // want "must be dispatched by Msg or Send method"
14
15
log .Fatal () // want "must be dispatched by Msg or Send method"
@@ -38,7 +39,7 @@ func bad() {
38
39
logger2 .Str ("foo" , "bar" )
39
40
}
40
41
41
- func ok () {
42
+ func expectNoWarnings () {
42
43
log .Fatal ().Send ()
43
44
log .Panic ().Msg ("" )
44
45
log .Debug ().Send ()
@@ -68,3 +69,9 @@ func ok() {
68
69
}
69
70
logger2 .Send ()
70
71
}
72
+
73
+ // https://github.com/ykadowak/zerologlint/pull/2
74
+ func packageNil () {
75
+ s := []int {1 , 2 , 3 }
76
+ slices .Sort (s )
77
+ }
You can’t perform that action at this time.
0 commit comments