jgautheron/goconst

Support filtering number literals in bases other than decimals

0xjac opened this issue · 1 comments

0xjac commented

The filtering logic for numbers uses strconv.Atoi to parse the value of numbers. This however assumes decimal and values in other bases like 0x0 are ignored even though they might be under the minimum threshold.

Replacing it by something like ParseInt(s, 0, 0) would handle parsing it in bases 2, 8, or 16 (determined by the prefix) as well as base 10.

Changed in v1.6.0.