From ed8dfad79e6a34721008b6d74135df58a6b4b491 Mon Sep 17 00:00:00 2001 From: FynnTang Date: Thu, 16 Feb 2023 11:43:59 +0800 Subject: [PATCH] feat: Completion of pattern calls --- cmd/protoc-gen-go-http/template.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/protoc-gen-go-http/template.go b/cmd/protoc-gen-go-http/template.go index e6e2d238d..75ba93c8c 100644 --- a/cmd/protoc-gen-go-http/template.go +++ b/cmd/protoc-gen-go-http/template.go @@ -86,10 +86,9 @@ func New{{.ServiceType}}HTTPClient (client *http.Client) {{.ServiceType}}HTTPCli {{range .MethodSets}} func (c *{{$svrType}}HTTPClientImpl) {{.Name}}(ctx context.Context, in *{{.Request}}, opts ...http.CallOption) (*{{.Reply}}, error) { var out {{.Reply}} - pattern := Operation{{.Method}}{{.OriginalName}}URL - path := binding.EncodeURL(pattern, in, {{not .HasBody}}) + path := binding.EncodeURL(Operation{{.Method}}{{.OriginalName}}URL, in, {{not .HasBody}}) opts = append(opts, http.Operation(Operation{{$svrType}}{{.OriginalName}})) - opts = append(opts, http.PathTemplate(pattern)) + opts = append(opts, http.PathTemplate(Operation{{.Method}}{{.OriginalName}}URL)) {{if .HasBody -}} err := c.cc.Invoke(ctx, "{{.Method}}", path, in{{.Body}}, &out{{.ResponseBody}}, opts...) {{else -}}