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
@mcdee This is not a bug. First, flow mode is not JSON. Additionally, '0x' is correctly interpreted as a string, so when the output is unmarshalled, it will be treated as a string. If you're expecting JSON, you should use yaml.YAMLToJSON
Is there an option to output anything that is a Go string as a quoted value in go-yaml? The change to behavior (this value was output quoted prior to 1.13.16) is causing broken tests in our repos, but we don't control the source data for the tests (round trip unmarshal and marshal) so we can't work around it easily.
@mcdee Basically, quotes are added only to values that cannot be interpreted as strings. Therefore, since '0x' is clearly a string, quotes cannot be added. Currently, there is no option to explicitly add quotes to strings, so implementing such a feature would require new development.
Describe the bug
Attempting to marshal the text string
'0x'
returns without quotes.To Reproduce
https://go.dev/play/p/Zu1JcjgLguZ
Expected behavior
The text string should be marshalled with quotes, as it is a string.
Version Variables
The text was updated successfully, but these errors were encountered: