mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-16 02:47:03 +02:00
parent
3d23d295c4
commit
872d31343a
@ -80,7 +80,7 @@ func genErrorsReason(gen *protogen.Plugin, file *protogen.File, g *protogen.Gene
|
||||
err := &errorInfo{
|
||||
Name: string(enum.Desc.Name()),
|
||||
Value: string(v.Desc.Name()),
|
||||
CamelValue: Case2Camel(string(v.Desc.Name())),
|
||||
CamelValue: case2Camel(string(v.Desc.Name())),
|
||||
HTTPCode: enumCode,
|
||||
}
|
||||
ew.Errors = append(ew.Errors, err)
|
||||
@ -92,9 +92,9 @@ func genErrorsReason(gen *protogen.Plugin, file *protogen.File, g *protogen.Gene
|
||||
return false
|
||||
}
|
||||
|
||||
func Case2Camel(name string) string {
|
||||
func case2Camel(name string) string {
|
||||
if !strings.Contains(name, "_") {
|
||||
return strings.Title(strings.ToLower(name))
|
||||
return name
|
||||
}
|
||||
name = strings.ToLower(name)
|
||||
name = strings.Replace(name, "_", " ", -1)
|
||||
|
Loading…
Reference in New Issue
Block a user