There are many instances where there are structs that have custom unmarshalers, mostly to convert a string to its underlying numeric enum-like type. Without a corresponding marshaler, a marshaled struct generates invalid yaml that can no longer be unmarshaled and used.
This implements the
Marshaler
interface from gopkg.in/yaml.v2 on structs satisfying itsUnmarshaler
interface.There are many instances where there are structs that have custom unmarshalers, mostly to convert a string to its underlying numeric enum-like type. Without a corresponding marshaler, a marshaled struct generates invalid yaml that can no longer be unmarshaled and used.