Skip to content

Commit 2fd8de7

Browse files
committed
passes/commentmap: add havecomment testdata
1 parent de8b809 commit 2fd8de7

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

passes/commentmap/commentmap_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func Test_Maps_Ignore(t *testing.T) {
3434
path: "notignore",
3535
found: false,
3636
},
37+
"havecomment": {
38+
path: "havecomment",
39+
found: true,
40+
},
3741
}
3842
for name, tt := range tests {
3943
name := name
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-- a.go --
2+
package havecomment
3+
4+
func _() {
5+
// var is no-op
6+
//lint:ignore check havecomment
7+
var _ = ""
8+
}
9+
10+
-- b.go --
11+
package havecomment
12+
13+
func _() {
14+
//lint:ignore check havecomment
15+
var _ = "" // var is no-op
16+
}
17+
18+
-- c.go --
19+
package havecomment
20+
21+
func _() {
22+
// var is no-op
23+
var _ = "" //lint:ignore check havecomment
24+
}

0 commit comments

Comments
 (0)