Closed schwichtgit closed 5 months ago
Thanks for the report! I am going to mark this as a bug. The issue is that Go's encoding/json
unmarshals JSON numbers into floats by default. We can do better by asking it to UseNumber
instead.
Just want to note: it's not a design goal to guarantee no byte change when getting a document through tomljson | jsontoml
.
Found myself in need of this and implemented support for json.Number
in https://github.com/pelletier/go-toml/pull/923
*The Issue It seems that jsontoml converts integer to float values.
How To Reproduce
$
tomljson example.toml | jsontoml > example2.toml
$
diff -Naur example.toml example2.toml
Expected behavior example.toml example2.toml should be identical, the diff should be empty.
Versions