fix(visitor): record string occurrence for accurate position reporting by TobyTheHutt · Pull Request #49 · jgautheron/goconst (original) (raw)

Fix string position tracking so duplicate string literals report all occurrences correctly.

Previously, addString only stored positions for the first occurrence and when minOccurrences was reached, which could under-report locations. The visitor now records every occurrence while still using the existing count map for threshold checks.

Changes:

Resolves: #45