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

pull/1423/head
Casper-Mars 3 years ago committed by GitHub
parent 73ce2941bd
commit f5339e3ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/protoc-gen-go-http/http.go
  2. 2
      cmd/protoc-gen-go-http/template.go
  3. 1
      hack/.lintcheck_failures

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

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

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

Loading…
Cancel
Save