-
Notifications
You must be signed in to change notification settings - Fork 43
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 integer overflow lint errors #4227
Conversation
7490297
to
03fd692
Compare
@@ -78,7 +79,13 @@ var ( | |||
|
|||
func init() { | |||
// Get the terminal width, if available, and set widths based on terminal width | |||
w, _, err := term.GetSize(int(os.Stdout.Fd())) | |||
fd := os.Stdout.Fd() |
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.
Admittedly this check is kind of pedantic since the max FD limit is well under 2^31 on any OS I've heard of.
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.
This is about getting the terminal width size which is used to format the CLI tables better, not the maximum amount of file descriptors on the OS
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.
In that sense I don't think we should remove it
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.
oh, I missed expanding this and responded solely on the comment that you added. You kept the width so my comment is obsolete then 👍
03fd692
to
059fd99
Compare
Fixed through a mixture of type changes, and ignoring the linter in places where I was confident that we would never hit an overflow in practice.
059fd99
to
9caa758
Compare
The new version of golangci introduces integer overflow checks. A number of such issues were reported in Minder upon update.
Fixed through a mixture of type changes, explicit checks, and ignoring the linter in places where I was confident that we would never hit an overflow in practice.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes #(related issue)
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: