pelletier / go-toml

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

jsontoml transforms integer to floats #780

Closed zupalex closed 2 years ago

zupalex commented 2 years ago

Hi,

using latest version of jsontoml (2.0.1) I observe an unintended behaviour. Integers become float

e.g.

echo '{"test": 4}' | jsontoml

will output

test = 4.0

I did not find related issues about this surprisingly, sorry if I'm missing something obvious

zupalex commented 2 years ago

Actually after testing encoding/json in go playground I realized that it's the json package that decodes int as float64 so not much you can do on your side I guess. Closing this issue.

YongBig commented 2 years ago

I have this problem. How did you solve this problem?

Actually after testing encoding/json in go playground I realized that it's the json package that decodes int as float64 so not much you can do on your side I guess. Closing this issue.