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
If you have an unused constant which is tagged with // nolint: deadcode a warning is still generated
package main import ( "fmt" ) const ( Valid = iota Invalid // nolint: deadcode Another ) func SetState(s int) { switch s { case Valid: fmt.Println("valid") default: fmt.Println("unknown state %v", s) } }
gometalinter.v1 --disable-all --enable deadcode --debug . DEBUG: PATH=/data/go/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin:/usr/local/go/bin:/data/go/bin:/data/go/bin DEBUG: GOPATH=/data/go DEBUG: GOBIN=/data/go/bin DEBUG: linting path . DEBUG: linting with deadcode: deadcode {path} (on .) DEBUG: executing /data/go/bin/deadcode ["."] DEBUG: warning: deadcode . returned exit status 2 DEBUG: deadcode hits 2: ^deadcode: (?P<path>.*?\.go):(?P<line>\d+):(?P<col>\d+):\s*(?P<message>.*)$ DEBUG: nolint: parsing job.go for directives DEBUG: deadcode linter took 11.886236ms DEBUG: nolint: parsing job.go took 226.93µs job.go:7:1:warning: Invalid is unused (deadcode) job.go:12:1:warning: SetState is unused (deadcode) DEBUG: total elapsed time 22.532206ms
Ignore the fact that SetState is unused, that's just a side effect of the simplified example.
The issue is caused by the fact that deadcode is reporting the issue for line 7 when in fact it should report line 9.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If you have an unused constant which is tagged with // nolint: deadcode a warning is still generated
Ignore the fact that SetState is unused, that's just a side effect of the simplified example.
The issue is caused by the fact that deadcode is reporting the issue for line 7 when in fact it should report line 9.
The text was updated successfully, but these errors were encountered: