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
as far as I can see a key in a yaml document can have no value and it is meant to be interpreted as a null value. https://stackoverflow.com/a/64462925
Which is fine when unmarshalling the document but I have code that is then also trying to marshal yaml again (and I'm working with yaml.Node instead of go models of the document to control ordering etc of maps)
And it blows up when Encoding this particular type of node.
Consider this reproducible:
this causes this panic:
as far as I can see a key in a yaml document can have no value and it is meant to be interpreted as a null value. https://stackoverflow.com/a/64462925
Which is fine when unmarshalling the document but I have code that is then also trying to marshal yaml again (and I'm working with yaml.Node instead of go models of the document to control ordering etc of maps)
And it blows up when Encoding this particular type of node.
The reason is pretty clear here: https://github.com/go-yaml/yaml/blob/v3/yaml.go#L269
The value returned from
p.parse()
isnil
and then this is dereferenced without anynil
checkThe text was updated successfully, but these errors were encountered: