goconst icon indicating copy to clipboard operation
goconst copied to clipboard

Support filtering number literals in bases other than decimals

Open 0xjac opened this issue 2 years ago • 0 comments

The filtering logic for numbers uses [strconv.Atoi](https://pkg.go.dev/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.

0xjac avatar Jun 10 '22 12:06 0xjac