Skip to content

Fix G115 false positives for guarded int64-to-byte conversions#1578

Merged
ccojocar merged 2 commits intosecurego:masterfrom
ccojocar:fix_g115
Mar 1, 2026
Merged

Fix G115 false positives for guarded int64-to-byte conversions#1578
ccojocar merged 2 commits intosecurego:masterfrom
ccojocar:fix_g115

Conversation

@ccojocar
Copy link
Copy Markdown
Member

@ccojocar ccojocar commented Mar 1, 2026

fixes #1577

Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
Copy link
Copy Markdown
Contributor

@ravisastryk ravisastryk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ccojocar ccojocar merged commit 6641fcf into securego:master Mar 1, 2026
7 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 71.73913% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.71%. Comparing base (3c9c3da) to head (aa00828).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
analyzers/conversion_overflow.go 71.73% 8 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1578      +/-   ##
==========================================
- Coverage   80.73%   80.71%   -0.03%     
==========================================
  Files         104      104              
  Lines        9852     9878      +26     
==========================================
+ Hits         7954     7973      +19     
- Misses       1412     1418       +6     
- Partials      486      487       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ldemailly
Copy link
Copy Markdown
Contributor

@ccojocar thanks for the quick fix, yet it doesn't seem to fix it unless I did something wrong #1577 (comment)

@ccojocar ccojocar deleted the fix_g115 branch March 6, 2026 07:40
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.

false positives in G115: checked with if prior to int64 -> byte

3 participants