1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-14 02:33:03 +02:00

fix[cmd]: if enum is a word in proto file, it should be camel too. (#1618)

This commit is contained in:
thinkgo 2021-11-10 21:09:16 +08:00 committed by GitHub
parent a8692e7dde
commit c70cdc9a11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)