func (yf *yamlFormatter) enumMarshal(declType codegen.TypeDecl) func(*codegen.Emitter) {
    return func(out *codegen.Emitter) {
        out.Commentf("Marshal%s implements %s.Marshal.", strings.ToUpper(formatYAML), formatYAML)
        out.Printlnf("func (j *%s) Marshal%s() (interface{}, error) {", declType.Name,
            strings.ToUpper(formatYAML))