go-yaml / yaml

YAML support for the Go language.
Other
6.83k stars 1.04k forks source link

Provide an option to format Int64 without scientific notation #730

Open tchiotludo opened 3 years ago

tchiotludo commented 3 years ago

I've a yaml with Int64 :

defaultTableLifetime: 3600000

It will be encoded as

defaultTableLifetime: 3.6e+06

In my case, It break my terraform provider that deal with yaml comparison. The server don't return scientific version, so the state store of terraform will compare the 2 string above and see difference.

Maybe it will be possible to add a Encoder option to control that ?

relate to https://github.com/go-yaml/yaml/issues/669

AllenShen commented 1 year ago

Need this feature badly!