1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-05 13:15:11 +02:00

fix(cmd/protoc-gen-go-http):part of #1430,fix cmd/protoc-gen-go-http (#1440)

This commit is contained in:
Casper-Mars 2021-09-07 14:26:24 +08:00 committed by GitHub
parent 73ce2941bd
commit f5339e3ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -177,10 +177,8 @@ func buildPathVars(method *protogen.Method, path string) (res []string) {
}
func camelCaseVars(s string) string {
var (
vars []string
subs = strings.Split(s, ".")
)
vars := make([]string, 0)
subs := strings.Split(s, ".")
for _, sub := range subs {
vars = append(vars, camelCase(sub))
}

View File

@ -124,5 +124,5 @@ func (s *serviceDesc) execute() string {
if err := tmpl.Execute(buf, s); err != nil {
panic(err)
}
return strings.Trim(string(buf.Bytes()), "\r\n")
return strings.Trim(buf.String(), "\r\n")
}

View File

@ -1,5 +1,4 @@
./examples
./cmd/protoc-gen-go-http
./cmd/kratos
./contrib/metrics/datadog
./contrib/config/nacos