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
This would create problems for roundtrips. Decoding works correctly for "1.0", but the the resulting encoding, if decoded again, would result in an integer rather than a float.
The text was updated successfully, but these errors were encountered:
Forget map keys, the encoder doesn't differentiate floats with no fractional part from integers in any context (although, the decoder does). This is because the encoder renders floats with Go's standard strconv.FormatFloat, for which no combination of arguments will grant the desired output in all cases. Further, per #430, the developers seem to think this is a good thing. Personally my reading of the YAML spec disagrees, but the YAML spec is frustratingly vague on the point.
See this playground example.
This would create problems for roundtrips. Decoding works correctly for "1.0", but the the resulting encoding, if decoded again, would result in an integer rather than a float.
The text was updated successfully, but these errors were encountered: