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
for code:
package main import ( "bytes" "io" ) //nolint:gas func main() { var buf io.Writer = &bytes.Buffer{} //nolint:errcheck buf.Write([]byte("123")) }
I have error errcheck
golangci-lint run main.go:12:11: Error return value of `buf.Write` is not checked (errcheck) buf.Write([]byte("123"))
Expected no errors:
Congrats! No issues were found.
The text was updated successfully, but these errors were encountered:
Fix #106: fix transitive expanding of nolint: we could nolint more li…
dda01b7
…nes than needed
@rekby thank you! cool bug :) @alecthomas FYI gometalinter has the same bug:
~/go/src/github.com/golangci/golangci-lint (master *)$ cat test.go package testdata import ( "bytes" "io" ) func noTransitiveExpanding() { //nolint:errcheck var buf io.Writer = &bytes.Buffer{} buf.Write([]byte("123")) } ~/go/src/github.com/golangci/golangci-lint (support/fix-nolint-transitive-expanding)$ gometalinter --disable-all -E errcheck test.go ~/go/src/github.com/golangci/golangci-lint (support/fix-nolint-transitive-expanding)$ golangci-lint run --disable-all -E errcheck --no-config test.go test.go:11:12: Error return value of `buf.Write` is not checked (errcheck) buf.Write([]byte("123")) ^
Sorry, something went wrong.
9fa9e2b
edge cases:
var buf bytes.Buffer binary.Write(&buf, binary.BigEndian, ....) v.WriteTo(&buf) // v is `io.WriterTo` // etc
No branches or pull requests
for code:
I have error errcheck
Expected no errors:
The text was updated successfully, but these errors were encountered: