Is it possible to preserve anchors and so forth when unmarshaling data structures back into YAML in Go?
These related questions below pertained to the same concept using Python, which seems do-able using the ruyamel.yaml package and according to the doc https://yaml.readthedocs.io/en/latest/example.html it seems possible to preserve comments, anchors, and references. This is referred to as a "round-trip".
- Round-trip parsing of data structure format (YAML or whatnot) preserving comments, for writing configuration
- Ruamel.yaml: How to access merge keys and comments in loaded OrderedDict
Using the example code in the README.md in https://github.com/go-yaml/yaml, I'm able to read yaml file into data structures. Then I derived a further example using anchors and references for a condensed document. But the anchoring and so forth is then lost when dumping back to YAML. Is it possible to do the same in Golang?