Closed cooscoos closed 1 month ago
Describe the bug Take a small float value in yaml, e.g.:
value: 0.00001
then:
map[string]interface{}
That new yaml now cannot be decoded because the unmarshal + marshal step changes value from 0.00001 to 1e-05.
0.00001
1e-05
1e-05 is interpreted by the final decoder as a string.
To Reproduce
Playground example: https://go.dev/play/p/mxsL_Dp_naC
This issue affects values of 0.00001 (1e-05) or lower. Larger values (e.g. 0.0001, 10000000000) are fine.
Expected behavior Unmarshal-marshal should result in yaml that a decoder can parse.
Version Variables
Describe the bug Take a small float value in yaml, e.g.:
then:
map[string]interface{}
That new yaml now cannot be decoded because the unmarshal + marshal step changes value from
0.00001
to1e-05
.1e-05 is interpreted by the final decoder as a string.
To Reproduce
Playground example: https://go.dev/play/p/mxsL_Dp_naC
This issue affects values of 0.00001 (1e-05) or lower. Larger values (e.g. 0.0001, 10000000000) are fine.
Expected behavior Unmarshal-marshal should result in yaml that a decoder can parse.
Version Variables