From 872d31343a9a504bc703de3dc25695b7e92e93c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Thu, 14 Oct 2021 16:14:34 +0800 Subject: [PATCH] revert: revert #1544 (#1548) --- cmd/protoc-gen-go-errors/errors.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/protoc-gen-go-errors/errors.go b/cmd/protoc-gen-go-errors/errors.go index 909690d66..455f91a73 100644 --- a/cmd/protoc-gen-go-errors/errors.go +++ b/cmd/protoc-gen-go-errors/errors.go @@ -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)