From 4a00ef946fdf8e82cc9dce7313c63db825adea4b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Aug 2024 14:16:10 +0300 Subject: [PATCH] [#107] protogen: Fix oneof getter scalar default value Signed-off-by: Evgenii Stratonikov --- util/protogen/internalgengo/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/protogen/internalgengo/file.go b/util/protogen/internalgengo/file.go index b5b351c..cd54fa0 100644 --- a/util/protogen/internalgengo/file.go +++ b/util/protogen/internalgengo/file.go @@ -148,7 +148,7 @@ func emitOneofGettersSetters(g *protogen.GeneratedFile, msg *protogen.Message, f g.P("}") 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)) } }