You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
I think it would be good to be able to deserialize ints into floats. encoding/json works that way for instance.
Versions
go-toml: github.com/pelletier/go-toml/v2 v2.0.6
go: go version go1.19.4 linux/amd64
operating system: Linux
Additional context
I could write the config values as 5.0 to get around this. However the same config is also used by a Perl parser, which has a different issue when expressing numbers as 5.0. It would be helpful in my case to be able to leave it as "5".
Thank you!
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a config with entries like
And I would like to decode them into a
float64
. This errors with:toml: cannot decode TOML integer into struct field main.conf.Foo of type float64
To Reproduce
Expected behavior
I think it would be good to be able to deserialize ints into floats.
encoding/json
works that way for instance.Versions
Additional context
I could write the config values as 5.0 to get around this. However the same config is also used by a Perl parser, which has a different issue when expressing numbers as 5.0. It would be helpful in my case to be able to leave it as "5".
Thank you!
The text was updated successfully, but these errors were encountered: