pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.73k stars 211 forks source link

uint64 range limited by int64 #781

Closed jmank88 closed 2 years ago

jmank88 commented 2 years ago

Describe the bug Attempting to unmarshal a value a larger than math.MaxInt64 results in a value out of range error from strconv.ParseInt, even when the target field is a uint64.

To Reproduce https://go.dev/play/p/L_zgsE-vlAl

Expected behavior I expected the full range of uint64 values to be supported.

Versions

pelletier commented 2 years ago

Thank you for reporting this!

pelletier commented 2 years ago

Merged https://github.com/pelletier/go-toml/commit/85bfc0ed5117cb316bbbcd9e65ecfcb95419be88. It prevents the asymmetry problem you pointed out by preventing uint64 > maxInt64 to be encoded.

Thank you again for reporting since and driving the discussion to improve the library!