Skip to content

Commit 3a8f11b

Browse files
committed
fix: fixes enum cli flags
1 parent 771cd7b commit 3a8f11b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/plugin/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ func (svc *Service) genCliUnmarshalMessage(f *g.File, msg *protogen.Message) {
853853
g.Return(g.Nil(), g.Qual("fmt", "Errorf").Call(g.Lit(fmt.Sprintf("unsupported enum value for %q flag: %%q", flag)), g.Id("cmd").Dot("String").Call(g.Lit(flag)))),
854854
)
855855
if oneof != nil {
856-
b.Id("result").Dot(oneof.GoName).Op("=").Op("&").Id(field.GoIdent.GoName).Values(g.Id(goName).Op(":").Id("v"))
856+
b.Id("result").Dot(oneof.GoName).Op("=").Op("&").Id(field.GoIdent.GoName).Values(g.Id(goName).Op(":").Id(field.Enum.GoIdent.GoName).Call(g.Id("v")))
857857
return
858858
}
859859
b.Id("result").Dot(goName).Op("=").Id(field.Enum.GoIdent.GoName).Call(g.Id("v"))

0 commit comments

Comments
 (0)