THRIFT-4260 Go context generation issue. Context is parameter in Interface not in implementation
Client: Go
Patch: taozle <zhangliyang26@gmail.com>
This closes #1312
diff --git a/tutorial/go/src/client.go b/tutorial/go/src/client.go
index 9106ac9..65027ea 100644
--- a/tutorial/go/src/client.go
+++ b/tutorial/go/src/client.go
@@ -27,17 +27,17 @@
)
func handleClient(client *tutorial.CalculatorClient) (err error) {
- client.Ping()
+ client.Ping(defaultCtx)
fmt.Println("ping()")
- sum, _ := client.Add(1, 1)
+ sum, _ := client.Add(defaultCtx, 1, 1)
fmt.Print("1+1=", sum, "\n")
work := tutorial.NewWork()
work.Op = tutorial.Operation_DIVIDE
work.Num1 = 1
work.Num2 = 0
- quotient, err := client.Calculate(1, work)
+ quotient, err := client.Calculate(defaultCtx, 1, work)
if err != nil {
switch v := err.(type) {
case *tutorial.InvalidOperation:
@@ -53,7 +53,7 @@
work.Op = tutorial.Operation_SUBTRACT
work.Num1 = 15
work.Num2 = 10
- diff, err := client.Calculate(1, work)
+ diff, err := client.Calculate(defaultCtx, 1, work)
if err != nil {
switch v := err.(type) {
case *tutorial.InvalidOperation:
@@ -66,7 +66,7 @@
fmt.Print("15-10=", diff, "\n")
}
- log, err := client.GetStruct(1)
+ log, err := client.GetStruct(defaultCtx, 1)
if err != nil {
fmt.Println("Unable to get struct:", err)
return err