summaryrefslogtreecommitdiff
path: root/tutorial/go
diff options
context:
space:
mode:
authorD. Can Celasun <can@dcc.im>2017-09-21 15:21:00 +0200
committerJames E. King, III <jking@apache.org>2017-11-03 18:21:40 -0700
commit4f77ab8e296d64c57e6ea1c6e3f0f152bc7d6a3a (patch)
treec3acd180d98bcfdb76c40dc5b6177e16bfc13719 /tutorial/go
parent847ecf3c1de8b297d6a29305b9f7871fcf609c36 (diff)
downloadthrift-4f77ab8e296d64c57e6ea1c6e3f0f152bc7d6a3a.tar.gz
THRIFT-4285 Move TX/RX methods from gen. code to library
This change removes a lot of duplication from generated code and allows the caller to customize how they can read from / write to the transport. Backwards compatible adapters make the change compatible with existing code in use by consuming applications. Client: Go This closes #1382
Diffstat (limited to 'tutorial/go')
-rw-r--r--tutorial/go/src/client.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/tutorial/go/src/client.go b/tutorial/go/src/client.go
index 65027ea05..25616bf4e 100644
--- a/tutorial/go/src/client.go
+++ b/tutorial/go/src/client.go
@@ -22,8 +22,9 @@ package main
import (
"crypto/tls"
"fmt"
- "git.apache.org/thrift.git/lib/go/thrift"
"tutorial"
+
+ "git.apache.org/thrift.git/lib/go/thrift"
)
func handleClient(client *tutorial.CalculatorClient) (err error) {
@@ -98,5 +99,7 @@ func runClient(transportFactory thrift.TTransportFactory, protocolFactory thrift
if err := transport.Open(); err != nil {
return err
}
- return handleClient(tutorial.NewCalculatorClientFactory(transport, protocolFactory))
+ iprot := protocolFactory.GetProtocol(transport)
+ oprot := protocolFactory.GetProtocol(transport)
+ return handleClient(tutorial.NewCalculatorClient(thrift.NewTStandardClient(iprot, oprot)))
}