Repository navigation
fix(G110): track decompression readers declared with var - #1852
Open
VISHNU0906 wants to merge 1 commit into
Open
VISHNU0906 wants to merge 1 commit into
VISHNU0906 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1852 +/- ##
==========================================
- Coverage 86.35% 86.35% -0.01%
==========================================
Files 112 112
Lines 9805 9812 +7
==========================================
+ Hits 8467 8473 +6
- Misses 1338 1339 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
G110 tracks decompression readers created with
:=or=, but not ones declared withvar, so this gives no finding:This adds
*ast.ValueSpecto the nodes G110 visits and records the declared variable the same way as an assignment. The assignment and declaration paths now share one small helper.Tests: three new G110 samples.
var r, gzErr = gzip.NewReader(f)withio.ReadAll(r)andvar r = flate.NewReader(&buf)withio.Copyare flagged; the samevarreader behindio.LimitReaderis not. The two positive samples fail with the rule change reverted.make testpasses on Go 1.26.11 and 1.27.4,make test-coverage(go test -race ./...) passes,golangci-lint run(v2.15.0) reports 0 issues and the taint benchmark guard passes.