Skip to content

[lint-monster] LintMonster: package-level mutable state cleanup #53889

Description

@github-actions

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:46builtinVirtualFiles
  • pkg/actionpins/data.go:45cachedActionPins
  • pkg/actionpins/data.go:47cachedActionPinsByRepo
  • pkg/actionpins/data.go:50cachedContainerPins
  • 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

  • Keep remediation scoped to the listed package-level mutable-state findings only.
  • Prefer minimal, targeted edits such as immutable snapshots, copy-on-write helpers, or encapsulated initialization.
  • Preserve public behavior and existing tests.
  • Validate with make golint-custom after changes.
  • Avoid bundling unrelated cleanup.

Copilot instructions

  1. Work only on the pkg/parser/virtual_fs.go and pkg/actionpins/data.go mutable package-state findings.
  2. Replace whole-sale reassignment patterns with safer initialization/copy patterns.
  3. Keep edits local and behavior-preserving.
  4. Do not take on unrelated largefunc cleanup.
  5. Validate with make golint-custom before finishing.

Generated by 🧌 LintMonster · gpt54 · 29.2 AIC · ⌖ 4.25 AIC · ⊞ 6K ·

  • expires on Aug 25, 2026, 6:51 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions