From 0db2443bc3405677592d7132a1df68b1109ff0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Wed, 26 Jun 2024 11:13:23 -0400 Subject: [PATCH] fix proto for call outputs ending with underscore --- templating.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templating.go b/templating.go index 51b0c98..9dcc0e4 100644 --- a/templating.go +++ b/templating.go @@ -55,7 +55,10 @@ func ParseFS(myFuncs template.FuncMap, fsys fs.FS, pattern string) (*template.Te func SanitizeProtoFieldName(name string) string { if strings.HasPrefix(name, "_") { - return "u" + name + name = "u" + name + } + if strings.HasSuffix(name, "_") { + name = name + "u" } return name }