fix(protoc-gen-go-errors): fix the camel case bug of name (#1544)

Signed-off-by: storyicon <yuanchao@bilibili.com>
pull/1545/head
storyicon 3 years ago committed by GitHub
parent 250bb5c8e7
commit 1e86faea1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/protoc-gen-go-errors/errors.go

@ -94,7 +94,7 @@ func genErrorsReason(gen *protogen.Plugin, file *protogen.File, g *protogen.Gene
func Case2Camel(name string) string {
if !strings.Contains(name, "_") {
return name
return strings.Title(strings.ToLower(name))
}
name = strings.ToLower(name)
name = strings.Replace(name, "_", " ", -1)

Loading…
Cancel
Save