bug: ignore comments don't work
tamayika opened this issue · 2 comments
tamayika commented
repro
git clone https://github.com/gcpug/zagane.git
cd zagane
- edit test code as follows.
diff --git a/passes/unstopiter/testdata/src/a/a.go b/passes/unstopiter/testdata/src/a/a.go
index 0ad4cf5..c78dd04 100644
--- a/passes/unstopiter/testdata/src/a/a.go
+++ b/passes/unstopiter/testdata/src/a/a.go
@@ -8,7 +8,8 @@ import (
func f1(ctx context.Context, client *spanner.Client) {
stmt := spanner.Statement{SQL: `SELECT 1`}
- _, _ = client.Single().Query(ctx, stmt).Next() // want "iterator must be stopped"
+ //lint:ignore unstopiter reason
+ _, _ = client.Single().Query(ctx, stmt).Next()
client.Single().Query(ctx, stmt).Stop() // OK
defer client.Single().Query(ctx, stmt).Stop() // OK
}
go test .\passes\unstopiter\unstopiter_test.go
Expected: Test passes
Actual: Test fails
$ go test .\passes\unstopiter\unstopiter_test.go
--- FAIL: Test (2.40s)
analysistest.go:251: a/a.go:12:30: unexpected diagnostic: iterator must be stopped
FAIL
FAIL command-line-arguments 2.550s
This is maybe github.com/gostaticanalysis/comment
bug or misusage.
tenntenn commented
Thank you for reporting. I'll investigate it:)
tenntenn commented
I think it is a bug of github.com/gostaticanalysis/comment .