Open alexandear opened 1 week ago
The following code in the file gocritic_test.go produces commentedOutCode false positive:
gocritic_test.go
commentedOutCode
package env_test import "fmt" func ExampleCommentedOutCode() { const c = "{Foo:a}" fmt.Printf("%v", c) // Output: {Foo:a} }
❯ gocritic check -enable commentedOutCode gocritic_test.go ./gocritic_test.go:8:2: commentedOutCode: may want to remove commented-out code
Found in the caarlos0/env repo:
caarlos0/env
❯ gocritic check -enable commentedOutCode example_test.go ./example_test.go:353:2: commentedOutCode: may want to remove commented-out code ./example_test.go:391:2: commentedOutCode: may want to remove commented-out code
The Output: prefix should be easy enough to recognize as we already have something like a list of "give up" words.
Output:
The following code in the file
gocritic_test.go
producescommentedOutCode
false positive:Found in the
caarlos0/env
repo: