THRIFT-4236 Support context in go generated code
Client: Go
Patch: taozle <zhangliyang26@gmail.com>

This closes #1309
diff --git a/test/go/src/common/clientserver_test.go b/test/go/src/common/clientserver_test.go
index 9f490ea..acc3dba 100644
--- a/test/go/src/common/clientserver_test.go
+++ b/test/go/src/common/clientserver_test.go
@@ -92,32 +92,32 @@
 
 func callEverythingWithMock(t *testing.T, client *thrifttest.ThriftTestClient, handler *MockThriftTest) {
 	gomock.InOrder(
-		handler.EXPECT().TestVoid(),
-		handler.EXPECT().TestString("thing").Return("thing", nil),
-		handler.EXPECT().TestBool(true).Return(true, nil),
-		handler.EXPECT().TestBool(false).Return(false, nil),
-		handler.EXPECT().TestByte(int8(42)).Return(int8(42), nil),
-		handler.EXPECT().TestI32(int32(4242)).Return(int32(4242), nil),
-		handler.EXPECT().TestI64(int64(424242)).Return(int64(424242), nil),
+		handler.EXPECT().TestVoid(gomock.Any()),
+		handler.EXPECT().TestString(gomock.Any(), "thing").Return("thing", nil),
+		handler.EXPECT().TestBool(gomock.Any(), true).Return(true, nil),
+		handler.EXPECT().TestBool(gomock.Any(), false).Return(false, nil),
+		handler.EXPECT().TestByte(gomock.Any(), int8(42)).Return(int8(42), nil),
+		handler.EXPECT().TestI32(gomock.Any(), int32(4242)).Return(int32(4242), nil),
+		handler.EXPECT().TestI64(gomock.Any(), int64(424242)).Return(int64(424242), nil),
 		// TODO: add TestBinary()
-		handler.EXPECT().TestDouble(float64(42.42)).Return(float64(42.42), nil),
-		handler.EXPECT().TestStruct(&thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}).Return(&thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}, nil),
-		handler.EXPECT().TestNest(&thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}).Return(&thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}, nil),
-		handler.EXPECT().TestMap(map[int32]int32{1: 2, 3: 4, 5: 42}).Return(map[int32]int32{1: 2, 3: 4, 5: 42}, nil),
-		handler.EXPECT().TestStringMap(map[string]string{"a": "2", "b": "blah", "some": "thing"}).Return(map[string]string{"a": "2", "b": "blah", "some": "thing"}, nil),
-		handler.EXPECT().TestSet([]int32{1, 2, 42}).Return([]int32{1, 2, 42}, nil),
-		handler.EXPECT().TestList([]int32{1, 2, 42}).Return([]int32{1, 2, 42}, nil),
-		handler.EXPECT().TestEnum(thrifttest.Numberz_TWO).Return(thrifttest.Numberz_TWO, nil),
-		handler.EXPECT().TestTypedef(thrifttest.UserId(42)).Return(thrifttest.UserId(42), nil),
-		handler.EXPECT().TestMapMap(int32(42)).Return(rmapmap, nil),
+		handler.EXPECT().TestDouble(gomock.Any(), float64(42.42)).Return(float64(42.42), nil),
+		handler.EXPECT().TestStruct(gomock.Any(), &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}).Return(&thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}, nil),
+		handler.EXPECT().TestNest(gomock.Any(), &thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}).Return(&thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}, nil),
+		handler.EXPECT().TestMap(gomock.Any(), map[int32]int32{1: 2, 3: 4, 5: 42}).Return(map[int32]int32{1: 2, 3: 4, 5: 42}, nil),
+		handler.EXPECT().TestStringMap(gomock.Any(), map[string]string{"a": "2", "b": "blah", "some": "thing"}).Return(map[string]string{"a": "2", "b": "blah", "some": "thing"}, nil),
+		handler.EXPECT().TestSet(gomock.Any(), []int32{1, 2, 42}).Return([]int32{1, 2, 42}, nil),
+		handler.EXPECT().TestList(gomock.Any(), []int32{1, 2, 42}).Return([]int32{1, 2, 42}, nil),
+		handler.EXPECT().TestEnum(gomock.Any(), thrifttest.Numberz_TWO).Return(thrifttest.Numberz_TWO, nil),
+		handler.EXPECT().TestTypedef(gomock.Any(), thrifttest.UserId(42)).Return(thrifttest.UserId(42), nil),
+		handler.EXPECT().TestMapMap(gomock.Any(), int32(42)).Return(rmapmap, nil),
 		// TODO: not testing insanity
-		handler.EXPECT().TestMulti(int8(42), int32(4242), int64(424242), map[int16]string{1: "blah", 2: "thing"}, thrifttest.Numberz_EIGHT, thrifttest.UserId(24)).Return(xxs, nil),
-		handler.EXPECT().TestException("some").Return(xcept),
-		handler.EXPECT().TestException("TException").Return(errors.New("Just random exception")),
-		handler.EXPECT().TestMultiException("Xception", "ignoreme").Return(nil, &thrifttest.Xception{ErrorCode: 1001, Message: "This is an Xception"}),
-		handler.EXPECT().TestMultiException("Xception2", "ignoreme").Return(nil, &thrifttest.Xception2{ErrorCode: 2002, StructThing: &thrifttest.Xtruct{StringThing: "This is an Xception2"}}),
-		handler.EXPECT().TestOneway(int32(2)).Return(nil),
-		handler.EXPECT().TestVoid(),
+		handler.EXPECT().TestMulti(gomock.Any(), int8(42), int32(4242), int64(424242), map[int16]string{1: "blah", 2: "thing"}, thrifttest.Numberz_EIGHT, thrifttest.UserId(24)).Return(xxs, nil),
+		handler.EXPECT().TestException(gomock.Any(), "some").Return(xcept),
+		handler.EXPECT().TestException(gomock.Any(), "TException").Return(errors.New("Just random exception")),
+		handler.EXPECT().TestMultiException(gomock.Any(), "Xception", "ignoreme").Return(nil, &thrifttest.Xception{ErrorCode: 1001, Message: "This is an Xception"}),
+		handler.EXPECT().TestMultiException(gomock.Any(), "Xception2", "ignoreme").Return(nil, &thrifttest.Xception2{ErrorCode: 2002, StructThing: &thrifttest.Xtruct{StringThing: "This is an Xception2"}}),
+		handler.EXPECT().TestOneway(gomock.Any(), int32(2)).Return(nil),
+		handler.EXPECT().TestVoid(gomock.Any()),
 	)
 	var err error
 	if err = client.TestVoid(); err != nil {