pelletier / go-toml

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

Allow `int`, `uint`, and `float` as map keys #958

Closed daniel-weisse closed 1 week ago

daniel-weisse commented 1 month ago

According to the toml specification, integers (or even floats) may be used as keys. This PR adds functionality to *Encoder.keyToString and *decoder.keyFromData to convert ints, uints, and floats to and from string.


benchstat results

pelletier commented 1 week ago

Feels like a good ergonomics improvement. Thank you for the patch!