-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
updates and fixes to linters #4828
Conversation
Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Tonis Tiigi <[email protected]>
.golangci.yml
Outdated
- unusedwrite | ||
# enable-all: true | ||
# disable: | ||
# - fieldalignment |
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.
fieldalignment is also somewhat interesting. Enabling it would mean 100+ updates to current structs. How many of these cases actually have practical benefits is not fully clear to me yet. This could be considered but needs more analysis before.
Shadow could catch some issues, but currently there are quite a lot of places where we intentionally use the same variable name, and changing it could hurt readability.
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.
With fieldalignment
, wouldn't that mean we couldn't keep our structs ordered for readability? Unless the memory usage is incredibly dramatic, I'd prefer to allow ordering/grouping of struct fields to be done to keep readability of the code.
Signed-off-by: Tonis Tiigi <[email protected]>
70b3c0f
to
61f4c90
Compare
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. +1 code format standardization 👍
Enable new nilness and unusedwrite linters that seem to be quite useful and did point to some actual issues.