diff --git a/src/go/enum_visitor.ts b/src/go/enum_visitor.ts index 94f185f..abb1995 100644 --- a/src/go/enum_visitor.ts +++ b/src/go/enum_visitor.ts @@ -101,7 +101,7 @@ func (e ${context.enum.name}) MarshalJSON() ([]byte, error) { return ${$.json}.Marshal(e.String()) } -// UnmarshalJSON unmashals a quoted json string to the enum value +// UnmarshalJSON unmarshals a quoted json string to the enum value func (e *${context.enum.name}) UnmarshalJSON(b []byte) error { var str string err := ${$.json}.Unmarshal(b, &str) @@ -120,7 +120,7 @@ func (e *${context.enum.name}) UnmarshalJSON(b []byte) error { return e.String(), nil } - // UnmarshalYAML unmashals a quoted YAML string to the enum value + // UnmarshalYAML unmarshals a quoted YAML string to the enum value func (e *${context.enum.name}) UnmarshalYAML(unmarshal func(any) error) error { var str string if err := unmarshal(&str); err != nil { diff --git a/src/go/struct_visitor.ts b/src/go/struct_visitor.ts index 140dcb6..885d092 100644 --- a/src/go/struct_visitor.ts +++ b/src/go/struct_visitor.ts @@ -66,7 +66,7 @@ export class StructVisitor extends GoVisitor { this.write(`type ${type.name} struct {\n`); if (writeTypeInfo) { - this.write(` ns\n`); + this.write(' ns `yaml:"-"`\n'); } } diff --git a/testdata/go/expected/pkg/outputtest/interfaces.go b/testdata/go/expected/pkg/outputtest/interfaces.go index 3cf8dad..367fa0f 100644 --- a/testdata/go/expected/pkg/outputtest/interfaces.go +++ b/testdata/go/expected/pkg/outputtest/interfaces.go @@ -207,7 +207,7 @@ func (e MyEnum) MarshalJSON() ([]byte, error) { return json.Marshal(e.String()) } -// UnmarshalJSON unmashals a quoted json string to the enum value +// UnmarshalJSON unmarshals a quoted json string to the enum value func (e *MyEnum) UnmarshalJSON(b []byte) error { var str string err := json.Unmarshal(b, &str) @@ -222,7 +222,7 @@ func (e MyEnum) MarshalYAML() (any, error) { return e.String(), nil } -// UnmarshalYAML unmashals a quoted YAML string to the enum value +// UnmarshalYAML unmarshals a quoted YAML string to the enum value func (e *MyEnum) UnmarshalYAML(unmarshal func(any) error) error { var str string if err := unmarshal(&str); err != nil {