-
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(linters): Remove blank identifiers and errors which are not needed to be handled #14399
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
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.
Awesome @zak-pawel! Thanks for looking into this!
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.
@zak-pawel should there be an update to the .golangci file to enable errcheck? Or was this the first in a series of PRs?
@powersj |
ok, and how do we prevent these in the future? Does check-blank: true need to be turned on as well? |
@powersj We may do it (as a part of different PR), but some of the findings (which will need to be addressed in non-test code) are not trivial to fix. |
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.
I'm going to approve and merge, but not close #13013 until we have a way to ensure additional blank identifiers are added to the code base.
Summary
Enabled
errcheck
linter has default exclusion list that looks like this today:Our
.golangci-lint
expands it with the following functions:I've reviewed all (hopefully) uses of these functions in the Telegraf code and removed blank identifiers that masked the reluctance to handle errors returned by above functions.
If any of these functions returned an error that was handled, I removed the handling of that error.
Checklist
Related issues