Summary
Daily make golint-custom surfaced a small non-largefunc cluster about package-level mutable slice/map state being reassigned, which risks shared-state leakage and data races.
Current findings: 5
Affected paths:
pkg/parser/virtual_fs.go:46 — builtinVirtualFiles
pkg/actionpins/data.go:45 — cachedActionPins
pkg/actionpins/data.go:47 — cachedActionPinsByRepo
pkg/actionpins/data.go:50 — cachedContainerPins
pkg/actionpins/data.go:52 — additional reassignment path for cachedContainerPins
Representative diagnostics:
pkg/parser/virtual_fs.go:46:2: package-level slice/map variable builtinVirtualFiles is mutated via wholesale re-assignment; mutating shared package state risks data races and can leak state across calls
pkg/actionpins/data.go:45:3: package-level slice/map variable cachedActionPins is mutated via wholesale re-assignment; mutating shared package state risks data races and can leak state across calls
Expected outcome
Refactor the affected code so package-level slice/map data is not reassigned in a way that creates shared mutable state hazards, while preserving existing behavior and call sites.
Remediation checklist
Copilot instructions
- Work only on the
pkg/parser/virtual_fs.go and pkg/actionpins/data.go mutable package-state findings.
- Replace whole-sale reassignment patterns with safer initialization/copy patterns.
- Keep edits local and behavior-preserving.
- Do not take on unrelated
largefunc cleanup.
- Validate with
make golint-custom before finishing.
Generated by 🧌 LintMonster · gpt54 · 29.2 AIC · ⌖ 4.25 AIC · ⊞ 6K · ◷
Summary
Daily
make golint-customsurfaced a small non-largefunccluster about package-level mutable slice/map state being reassigned, which risks shared-state leakage and data races.Current findings: 5
Affected paths:
pkg/parser/virtual_fs.go:46—builtinVirtualFilespkg/actionpins/data.go:45—cachedActionPinspkg/actionpins/data.go:47—cachedActionPinsByRepopkg/actionpins/data.go:50—cachedContainerPinspkg/actionpins/data.go:52— additional reassignment path forcachedContainerPinsRepresentative diagnostics:
pkg/parser/virtual_fs.go:46:2: package-level slice/map variable builtinVirtualFiles is mutated via wholesale re-assignment; mutating shared package state risks data races and can leak state across callspkg/actionpins/data.go:45:3: package-level slice/map variable cachedActionPins is mutated via wholesale re-assignment; mutating shared package state risks data races and can leak state across callsExpected outcome
Refactor the affected code so package-level slice/map data is not reassigned in a way that creates shared mutable state hazards, while preserving existing behavior and call sites.
Remediation checklist
make golint-customafter changes.Copilot instructions
pkg/parser/virtual_fs.goandpkg/actionpins/data.gomutable package-state findings.largefunccleanup.make golint-custombefore finishing.