From c6caa0d3acc70be47b5dab11a21e6a41583356fe Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 18 May 2021 14:03:21 +0300 Subject: [PATCH] tag fix Signed-off-by: Vasiliy Tolstov --- ast.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ast.go b/ast.go index 0cadb82..966e4a9 100644 --- a/ast.go +++ b/ast.go @@ -44,7 +44,10 @@ func (g *Generator) astGenerate(plugin *protogen.Plugin) error { if !ok { mp = make(map[string]map[string]*structtag.Tags) } - nmp := make(map[string]*structtag.Tags) + nmp, ok := mp[message.GoIdent.GoName] + if !ok { + nmp = make(map[string]*structtag.Tags) + } tags, err := structtag.Parse(opts.(string)) if err != nil { return err