From 90f2a39b84201394f3f5d81ec8b4d6d4e4f4fa05 Mon Sep 17 00:00:00 2001 From: Hellyson Rodrigo Parteka Date: Tue, 27 Sep 2022 14:06:16 -0300 Subject: [PATCH] fix: remove pointer receiver Fixes #10 --- gen/template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/template.go b/gen/template.go index 82037ee..5a37336 100644 --- a/gen/template.go +++ b/gen/template.go @@ -76,12 +76,12 @@ import ( messageTemplate = template.Must(template.New("message").Parse(` // MarshalJSON implements json.Marshaler -func (msg *{{.GoIdent.GoName}}) MarshalJSON() ([]byte,error) { +func (msg {{.GoIdent.GoName}}) MarshalJSON() ([]byte,error) { return protojson.MarshalOptions { UseEnumNumbers: {{.EnumsAsInts}}, EmitUnpopulated: {{.EmitDefaults}}, UseProtoNames: {{.OrigName}}, - }.Marshal(msg) + }.Marshal(&msg) } // UnmarshalJSON implements json.Unmarshaler