Skip to content
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: revive.redefines-builtin-id lint warnings #1257

Merged
merged 4 commits into from
Nov 30, 2024

Conversation

alexandear
Copy link
Contributor

The PR fixes revive.redefines-builtin-id lint warnings:

❯ golangci-lint run
analyzers/conversion_overflow.go:144:2: redefines-builtin-id: redefinition of the built-in function min (revive)
        var min int
        ^
analyzers/conversion_overflow.go:145:2: redefines-builtin-id: redefinition of the built-in function max (revive)
        var max uint
        ^
analyzers/conversion_overflow.go:155:3: redefines-builtin-id: redefinition of the built-in function max (revive)
                max = (1 << uint(shiftAmount)) - 1
                ^
analyzers/conversion_overflow.go:156:3: redefines-builtin-id: redefinition of the built-in function min (revive)
                min = -1 << (intSize - 1)
                ^
analyzers/conversion_overflow.go:159:3: redefines-builtin-id: redefinition of the built-in function max (revive)
                max = (1 << uint(intSize)) - 1
                ^
analyzers/conversion_overflow.go:160:3: redefines-builtin-id: redefinition of the built-in function min (revive)
                min = 0
                ^

This is because Go 1.22 has the following built-ins:

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 66.66%. Comparing base (1216c9b) to head (146322e).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
analyzers/conversion_overflow.go 92.30% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1257      +/-   ##
==========================================
- Coverage   68.49%   66.66%   -1.84%     
==========================================
  Files          75       75              
  Lines        4384     5186     +802     
==========================================
+ Hits         3003     3457     +454     
- Misses       1233     1581     +348     
  Partials      148      148              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ccojocar ccojocar merged commit 8c602d0 into securego:master Nov 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants