diff --git a/passes/AT001/testdata/src/a/comment_ignore.go b/passes/AT001/testdata/src/a/comment_ignore.go index d8b0d690..677e21cc 100644 --- a/passes/AT001/testdata/src/a/comment_ignore.go +++ b/passes/AT001/testdata/src/a/comment_ignore.go @@ -7,14 +7,24 @@ import ( func fcommentignore() { _ = r.TestCase{} //lintignore:AT001 + _ = r.TestCase{} // lintignore:AT001 + //lintignore:AT001 _ = r.TestCase{} + // lintignore:AT001 + _ = r.TestCase{} + //lintignore:AT001,AT002 _ = r.TestCase{} _ = r.TestCase{} //lintignore:AT001 // extra comment + _ = r.TestCase{} // lintignore:AT001 // extra comment + + // lintignore:AT001 // extra comment + _ = r.TestCase{} + //lintignore:AT001 // extra comment _ = r.TestCase{} @@ -30,6 +40,11 @@ func fcommentignore() { // extra comment _ = r.TestCase{} + // extra comment + // lintignore:AT001 + // extra comment + _ = r.TestCase{} + //lintignore:AT001 // extra comment _ = r.TestCase{} diff --git a/passes/commentignore/ignore.go b/passes/commentignore/ignore.go index b7e4afda..fb6767d3 100644 --- a/passes/commentignore/ignore.go +++ b/passes/commentignore/ignore.go @@ -48,7 +48,7 @@ func run(pass *analysis.Pass) (interface{}, error) { } // Remove // comment prefix - commentText := strings.TrimPrefix(comment.Text, "//") + commentText := strings.TrimLeft(strings.TrimPrefix(comment.Text, "//"), " ") if strings.HasPrefix(commentText, commentIgnorePrefix) { commentIgnore := strings.TrimPrefix(commentText, commentIgnorePrefix)