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

G115 Struct Attribute Checks #1221

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

czechbol
Copy link
Contributor

Similarly to the arithmetic example in #1212, the value being checked is, according to the SSA, different from the value being converted. So we have to be a bit smarter. Not as smart as with the arithmetic though.

I also found that explicit checks are still lacking, I partly fixed them and I'll document the rest in the issue.

@czechbol
Copy link
Contributor Author

czechbol commented Sep 12, 2024

Thanks @Victoremepunto for reporting this issue twice, I didn't see it the first time.
I've tested this PR against your codebase and it's not reporting G115 anymore.

@codecov-commenter
Copy link

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

Codecov Report

Attention: Patch coverage is 87.50000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 68.66%. Comparing base (5f3194b) to head (e64423b).

Files with missing lines Patch % Lines
analyzers/conversion_overflow.go 87.50% 3 Missing and 2 partials ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1221      +/-   ##
==========================================
+ Coverage   68.48%   68.66%   +0.17%     
==========================================
  Files          75       75              
  Lines        4360     4381      +21     
==========================================
+ Hits         2986     3008      +22     
- Misses       1226     1227       +1     
+ Partials      148      146       -2     

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

@Victoremepunto
Copy link

Thanks @Victoremepunto for reporting this issue twice, I didn't see it the first time. I've tested this PR against your codebase and it's not reporting G115 anymore.

Saw that. Thanks, I appreciate the help, looking forward to the release!

@ccojocar ccojocar merged commit 1f3bdd9 into securego:master Sep 16, 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.

4 participants