Open fgm opened 1 year ago
Data with cycles cause the encoder to never return.
Example: https://go.dev/play/p/sWfo5Hj4M6V
The encoder could at least detect the cycle and return an error like the json package does, or even in some cases use a reference to represent the cycle pointer.
@fgm Note that yaml.v3 doesn't preserve references when deserializing. Example.
Edit: I'm wrong. references are preserved when deserializing into yaml.Node. Example.
yaml.Node
Data with cycles cause the encoder to never return.
Example: https://go.dev/play/p/sWfo5Hj4M6V
The encoder could at least detect the cycle and return an error like the json package does, or even in some cases use a reference to represent the cycle pointer.