Skip to content

Commit

Permalink
protoc-gen-go: remove deprecated function in grpc (protocolbuffers#592)…
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnet committed May 11, 2018
1 parent 3fac2a2 commit 7c4add5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions protoc-gen-go/grpc/grpc.go
Expand Up @@ -307,15 +307,15 @@ func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar strin
if !method.GetServerStreaming() && !method.GetClientStreaming() {
g.P("out := new(", outType, ")")
// TODO: Pass descExpr to Invoke.
g.P("err := ", grpcPkg, `.Invoke(ctx, "`, sname, `", in, out, c.cc, opts...)`)
g.P(`err := c.cc.Invoke(ctx, "`, sname, `", in, out, opts...)`)
g.P("if err != nil { return nil, err }")
g.P("return out, nil")
g.P("}")
g.P()
return
}
streamType := unexport(servName) + methName + "Client"
g.P("stream, err := ", grpcPkg, ".NewClientStream(ctx, ", descExpr, `, c.cc, "`, sname, `", opts...)`)
g.P("stream, err := c.cc.NewStream(ctx, ", descExpr, `, "`, sname, `", opts...)`)
g.P("if err != nil { return nil, err }")
g.P("x := &", streamType, "{stream}")
if !method.GetClientStreaming() {
Expand Down
2 changes: 1 addition & 1 deletion protoc-gen-go/testdata/deprecated/deprecated.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions protoc-gen-go/testdata/grpc/grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c4add5

Please sign in to comment.