Skip to content

Releases: wework/yaml

Fix nil panic for Struct Meta

21 Apr 15:54
243966e
Compare
Choose a tag to compare

The previous release worked for its intended purpose of updating a yaml file in place. However if using the structs generate a new yaml file it panics when the StructMeta is nil because it is unsettable by users outside of unmarshalling yaml.

Now handles nil StructMeta gracefully.

Yaml with metadata

12 Apr 21:47
8e076d9
Compare
Choose a tag to compare

This release adds support for the yaml.StructMeta interface. By adding a field of type yaml.StructMeta to store metadata the relative positioning of fields as well as comments, the yaml package can now support update in place for structs.

This is a great boon when working on config files that are regularly checked into git as they will only display line changes for the changed field rather than reordering the entire document according to the ordering the fields appear on the struct.