How goconst works
mastergoconst analyzes Go source code to detect string and (optionally) number literals that appear multiple times.
Key behaviors:
- Exact literal matching: It compares complete, unquoted literal values. It does not detect repeated substrings within larger strings.
- Constant handling: By default,
constdeclarations are skipped. To include them, use-match-constant(to match strings against existing constants) or-find-duplicates(to find constants sharing the same value). - Unicode support: String length is measured in runes rather than bytes, ensuring multi-byte Unicode characters are handled correctly when using
-min-length.