Skip to content

Commit

Permalink
fix proto for call outputs ending with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Jun 26, 2024
1 parent 6f3d45a commit 0db2443
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templating.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 0db2443

Please sign in to comment.