As part of my work on go-raml, I needed some additional capabilities from go-yaml, so I forked it and released my own version of it (until it’s merged in, if at all, since me and the main developer of go-yaml see things a bit differently). Here’s the details
New Features: * Added new regexp flag: Unmarshal all encountered YAML values with keys that match the regular expression into the tagged field of a struct, which must be a map or a slice of a type that the YAML value should be unmarshaled into. [Unmarshaling only] * Now dies in case of a badly formatted YAML tag in a struct field Bugs: * When a type implementing UnmarshalYAML calls the the unmarshaler func() to unmarshal to a specific type, which fails, followed by it calling the func() again with a different output value which suceeds, the YAML unmarshaling process still failed. Issue was d.terrs == nil check, but not len(d.terrs) == 0 Tests: * Lots of new tests for the regexp flag - regexp unmarshaling into maps, slices, regexp priority etc.
Here’s the fork: github.com/advance512/yaml