-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
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
chore: Remove revive:unhandled-error
- errcheck
is more flexible
#13008
Conversation
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
Maybe add a "closes #12892"? |
I think we do agree to not enable G104 for the reason you outlined, don't we @powersj? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for cleaning up @zak-pawel.
Additionally to these we might also want to cleanup all _, _ = xyz.Write...
calls as they are also a product of these checks. You can find them with grep -nr '_, _ = (\w\+\.)\+Write' *
...
Created new issue for that: #13013 |
It doesn't make sense to support two linters for checking if returned error is handled.
errcheck
is able to find more problems, and have default exclusion list (which can be extended in.golangci.yml
)https://github.com/kisielk/errcheck/blob/master/errcheck/excludes.go#L11
revive
allows to exclude only functions.errcheck
supports also methods, so doesn't need a lot of repeating//nolint
's in code.