We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deadcode produces false positives if there is a main_test.go file which is part of the main package. To reproduce, create the following files:
deadcode
main_test.go
main
main.go:
main.go
package main import "fmt" func main() { fmt.Println("derp") }
main_test.go:
package main import ( "fmt" "testing" ) func TestMain(t *testing.T) { fmt.Println("herp") }
This produces the following error message when running golangci-lint run:
golangci-lint run
main_test.go:8:6: `TestMain` is unused (deadcode) func TestMain(t *testing.T) { ^
The false positive doesn't occur, if the package of the testing file is changed to main_test.
main_test
The text was updated successfully, but these errors were encountered:
Fix #109, #116, #131: don't report in deadcode about unused test func…
001f788
…tions in main package
thank you for reporting!
Sorry, something went wrong.
88ebabc
Fixed it
Thanks!
No branches or pull requests
deadcode
produces false positives if there is amain_test.go
file which is part of themain
package. To reproduce, create the following files:main.go
:main_test.go
:This produces the following error message when running
golangci-lint run
:The false positive doesn't occur, if the package of the testing file is changed to
main_test
.The text was updated successfully, but these errors were encountered: