Skip to content

Commit

Permalink
fix(protoc-gen-go-errors): fix the camel case bug of name (#1544)
Browse files Browse the repository at this point in the history
Signed-off-by: storyicon <[email protected]>
  • Loading branch information
storyicon authored Oct 13, 2021
1 parent 250bb5c commit 1e86fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/protoc-gen-go-errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1e86fae

Please sign in to comment.