-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: remove redundant nil check #3089
Conversation
Signed-off-by: knbr13 <[email protected]>
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.
Yep. 👍
Interesting that we’re not getting this flagged by staticcheck in our golangci-lint runs as we definitely have sc enabled here |
That’s just the config equivalent of the cli flag to disable all the default linters and only enable explicitly defined ones |
Very strange, run via golangci-lint we get no results for staticcheck even if we disable all config and default excludes:
But standalone staticcheck flags a few different things including S1009:
|
the for reference: https://golangci-lint.run/usage/linters/#staticcheck |
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.
Lgtm
mocks/async_producer.go remove unnecessay nil check.
because
len(slice)
where slice == nil is always equal to 0,staticcheck
will highlight this optimization with the following message:for reference: staticcheck S1009