I'm using Go-Yaml to serialize some maps to YAML. Is there a way to ensure the serialized YAML is writen with the keys in the order they were inserted into the Go Map? Or will it be necessary to reimplement the Marshal interface myself?
Go maps do not keep track of order of insertion. In order to do this you'd have to implement your own mechanism for reading in the keys and storing the order.