[#107] protogen: Fix oneof getter scalar default value

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-08-26 14:16:10 +03:00
parent f484ce6b0b
commit 4a00ef946f

View file

@ -148,7 +148,7 @@ func emitOneofGettersSetters(g *protogen.GeneratedFile, msg *protogen.Message, f
g.P("}") g.P("}")
ft := fieldType(g, ff) ft := fieldType(g, ff)
emitGetterSetter(g, ff.GoIdent.GoName, ff.GoName, ft.String(), "nil") emitGetterSetter(g, ff.GoIdent.GoName, ff.GoName, ft.String(), fieldDefaultValue(ff))
} }
} }