diff --git a/test/go/src/bin/stress/go17.go b/test/go/src/bin/stress/go17.go
new file mode 100644
index 0000000..81f1ad8
--- /dev/null
+++ b/test/go/src/bin/stress/go17.go
@@ -0,0 +1,62 @@
+// +build go1.7
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package main
+
+import (
+	"context"
+	"sync/atomic"
+)
+
+type handler struct{}
+
+func (h *handler) EchoVoid(ctx context.Context) (err error) {
+	atomic.AddInt64(&counter, 1)
+	return nil
+}
+func (h *handler) EchoByte(ctx context.Context, arg int8) (r int8, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoI32(ctx context.Context, arg int32) (r int32, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoI64(ctx context.Context, arg int64) (r int64, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoString(ctx context.Context, arg string) (r string, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoList(ctx context.Context, arg []int8) (r []int8, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoSet(ctx context.Context, arg map[int8]struct{}) (r map[int8]struct{}, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoMap(ctx context.Context, arg map[int8]int8) (r map[int8]int8, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
diff --git a/test/go/src/bin/stress/main.go b/test/go/src/bin/stress/main.go
index 1f713bb..e8e6b2a 100644
--- a/test/go/src/bin/stress/main.go
+++ b/test/go/src/bin/stress/main.go
@@ -216,38 +216,3 @@
 
 	done.Done()
 }
-
-type handler struct{}
-
-func (h *handler) EchoVoid() (err error) {
-	atomic.AddInt64(&counter, 1)
-	return nil
-}
-func (h *handler) EchoByte(arg int8) (r int8, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
-func (h *handler) EchoI32(arg int32) (r int32, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
-func (h *handler) EchoI64(arg int64) (r int64, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
-func (h *handler) EchoString(arg string) (r string, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
-func (h *handler) EchoList(arg []int8) (r []int8, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
-func (h *handler) EchoSet(arg map[int8]struct{}) (r map[int8]struct{}, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
-func (h *handler) EchoMap(arg map[int8]int8) (r map[int8]int8, err error) {
-	atomic.AddInt64(&counter, 1)
-	return arg, nil
-}
diff --git a/test/go/src/bin/stress/pre_go17.go b/test/go/src/bin/stress/pre_go17.go
new file mode 100644
index 0000000..07ae5c6
--- /dev/null
+++ b/test/go/src/bin/stress/pre_go17.go
@@ -0,0 +1,63 @@
+// +build !go1.7
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package main
+
+import (
+	"sync/atomic"
+
+	"golang.org/x/net/context"
+)
+
+type handler struct{}
+
+func (h *handler) EchoVoid(ctx context.Context) (err error) {
+	atomic.AddInt64(&counter, 1)
+	return nil
+}
+func (h *handler) EchoByte(ctx context.Context, arg int8) (r int8, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoI32(ctx context.Context, arg int32) (r int32, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoI64(ctx context.Context, arg int64) (r int64, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoString(ctx context.Context, arg string) (r string, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoList(ctx context.Context, arg []int8) (r []int8, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoSet(ctx context.Context, arg map[int8]struct{}) (r map[int8]struct{}, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
+func (h *handler) EchoMap(ctx context.Context, arg map[int8]int8) (r map[int8]int8, err error) {
+	atomic.AddInt64(&counter, 1)
+	return arg, nil
+}
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 {
diff --git a/test/go/src/common/mock_handler.go b/test/go/src/common/mock_handler.go
index b6738ee..3960e1a 100644
--- a/test/go/src/common/mock_handler.go
+++ b/test/go/src/common/mock_handler.go
@@ -23,267 +23,313 @@
 package common
 
 import (
-	gomock "github.com/golang/mock/gomock"
 	thrifttest "gen/thrifttest"
+	gomock "github.com/golang/mock/gomock"
+	context "golang.org/x/net/context"
 )
 
-// Mock of ThriftTest interface
+// MockThriftTest is a mock of ThriftTest interface
 type MockThriftTest struct {
 	ctrl     *gomock.Controller
-	recorder *_MockThriftTestRecorder
+	recorder *MockThriftTestMockRecorder
 }
 
-// Recorder for MockThriftTest (not exported)
-type _MockThriftTestRecorder struct {
+// MockThriftTestMockRecorder is the mock recorder for MockThriftTest
+type MockThriftTestMockRecorder struct {
 	mock *MockThriftTest
 }
 
+// NewMockThriftTest creates a new mock instance
 func NewMockThriftTest(ctrl *gomock.Controller) *MockThriftTest {
 	mock := &MockThriftTest{ctrl: ctrl}
-	mock.recorder = &_MockThriftTestRecorder{mock}
+	mock.recorder = &MockThriftTestMockRecorder{mock}
 	return mock
 }
 
-func (_m *MockThriftTest) EXPECT() *_MockThriftTestRecorder {
+// EXPECT returns an object that allows the caller to indicate expected use
+func (_m *MockThriftTest) EXPECT() *MockThriftTestMockRecorder {
 	return _m.recorder
 }
 
-func (_m *MockThriftTest) TestBool(_param0 bool) (bool, error) {
-	ret := _m.ctrl.Call(_m, "TestBool", _param0)
-	ret0, _ := ret[0].(bool)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-func (_mr *_MockThriftTestRecorder) TestBool(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestBool", arg0)
-}
-
-
-func (_m *MockThriftTest) TestByte(_param0 int8) (int8, error) {
-	ret := _m.ctrl.Call(_m, "TestByte", _param0)
-	ret0, _ := ret[0].(int8)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-func (_mr *_MockThriftTestRecorder) TestByte(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestByte", arg0)
-}
-
-func (_m *MockThriftTest) TestDouble(_param0 float64) (float64, error) {
-	ret := _m.ctrl.Call(_m, "TestDouble", _param0)
-	ret0, _ := ret[0].(float64)
-	ret1, _ := ret[1].(error)
-	return ret0, ret1
-}
-
-func (_mr *_MockThriftTestRecorder) TestDouble(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestDouble", arg0)
-}
-
-func (_m *MockThriftTest) TestBinary(_param0 []byte) ([]byte, error) {
-	ret := _m.ctrl.Call(_m, "TestBinary", _param0)
+// TestBinary mocks base method
+func (_m *MockThriftTest) TestBinary(_param0 context.Context, _param1 []byte) ([]byte, error) {
+	ret := _m.ctrl.Call(_m, "TestBinary", _param0, _param1)
 	ret0, _ := ret[0].([]byte)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestBinary(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestBinary", arg0)
+// TestBinary indicates an expected call of TestBinary
+func (_mr *MockThriftTestMockRecorder) TestBinary(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestBinary", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestEnum(_param0 thrifttest.Numberz) (thrifttest.Numberz, error) {
-	ret := _m.ctrl.Call(_m, "TestEnum", _param0)
+// TestBool mocks base method
+func (_m *MockThriftTest) TestBool(_param0 context.Context, _param1 bool) (bool, error) {
+	ret := _m.ctrl.Call(_m, "TestBool", _param0, _param1)
+	ret0, _ := ret[0].(bool)
+	ret1, _ := ret[1].(error)
+	return ret0, ret1
+}
+
+// TestBool indicates an expected call of TestBool
+func (_mr *MockThriftTestMockRecorder) TestBool(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestBool", arg0, arg1)
+}
+
+// TestByte mocks base method
+func (_m *MockThriftTest) TestByte(_param0 context.Context, _param1 int8) (int8, error) {
+	ret := _m.ctrl.Call(_m, "TestByte", _param0, _param1)
+	ret0, _ := ret[0].(int8)
+	ret1, _ := ret[1].(error)
+	return ret0, ret1
+}
+
+// TestByte indicates an expected call of TestByte
+func (_mr *MockThriftTestMockRecorder) TestByte(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestByte", arg0, arg1)
+}
+
+// TestDouble mocks base method
+func (_m *MockThriftTest) TestDouble(_param0 context.Context, _param1 float64) (float64, error) {
+	ret := _m.ctrl.Call(_m, "TestDouble", _param0, _param1)
+	ret0, _ := ret[0].(float64)
+	ret1, _ := ret[1].(error)
+	return ret0, ret1
+}
+
+// TestDouble indicates an expected call of TestDouble
+func (_mr *MockThriftTestMockRecorder) TestDouble(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestDouble", arg0, arg1)
+}
+
+// TestEnum mocks base method
+func (_m *MockThriftTest) TestEnum(_param0 context.Context, _param1 thrifttest.Numberz) (thrifttest.Numberz, error) {
+	ret := _m.ctrl.Call(_m, "TestEnum", _param0, _param1)
 	ret0, _ := ret[0].(thrifttest.Numberz)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestEnum(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestEnum", arg0)
+// TestEnum indicates an expected call of TestEnum
+func (_mr *MockThriftTestMockRecorder) TestEnum(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestEnum", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestException(_param0 string) error {
-	ret := _m.ctrl.Call(_m, "TestException", _param0)
+// TestException mocks base method
+func (_m *MockThriftTest) TestException(_param0 context.Context, _param1 string) error {
+	ret := _m.ctrl.Call(_m, "TestException", _param0, _param1)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
-func (_mr *_MockThriftTestRecorder) TestException(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestException", arg0)
+// TestException indicates an expected call of TestException
+func (_mr *MockThriftTestMockRecorder) TestException(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestException", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestI32(_param0 int32) (int32, error) {
-	ret := _m.ctrl.Call(_m, "TestI32", _param0)
+// TestI32 mocks base method
+func (_m *MockThriftTest) TestI32(_param0 context.Context, _param1 int32) (int32, error) {
+	ret := _m.ctrl.Call(_m, "TestI32", _param0, _param1)
 	ret0, _ := ret[0].(int32)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestI32(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestI32", arg0)
+// TestI32 indicates an expected call of TestI32
+func (_mr *MockThriftTestMockRecorder) TestI32(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestI32", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestI64(_param0 int64) (int64, error) {
-	ret := _m.ctrl.Call(_m, "TestI64", _param0)
+// TestI64 mocks base method
+func (_m *MockThriftTest) TestI64(_param0 context.Context, _param1 int64) (int64, error) {
+	ret := _m.ctrl.Call(_m, "TestI64", _param0, _param1)
 	ret0, _ := ret[0].(int64)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestI64(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestI64", arg0)
+// TestI64 indicates an expected call of TestI64
+func (_mr *MockThriftTestMockRecorder) TestI64(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestI64", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestInsanity(_param0 *thrifttest.Insanity) (map[thrifttest.UserId]map[thrifttest.Numberz]*thrifttest.Insanity, error) {
-	ret := _m.ctrl.Call(_m, "TestInsanity", _param0)
+// TestInsanity mocks base method
+func (_m *MockThriftTest) TestInsanity(_param0 context.Context, _param1 *thrifttest.Insanity) (map[thrifttest.UserId]map[thrifttest.Numberz]*thrifttest.Insanity, error) {
+	ret := _m.ctrl.Call(_m, "TestInsanity", _param0, _param1)
 	ret0, _ := ret[0].(map[thrifttest.UserId]map[thrifttest.Numberz]*thrifttest.Insanity)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestInsanity(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestInsanity", arg0)
+// TestInsanity indicates an expected call of TestInsanity
+func (_mr *MockThriftTestMockRecorder) TestInsanity(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestInsanity", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestList(_param0 []int32) ([]int32, error) {
-	ret := _m.ctrl.Call(_m, "TestList", _param0)
+// TestList mocks base method
+func (_m *MockThriftTest) TestList(_param0 context.Context, _param1 []int32) ([]int32, error) {
+	ret := _m.ctrl.Call(_m, "TestList", _param0, _param1)
 	ret0, _ := ret[0].([]int32)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestList(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestList", arg0)
+// TestList indicates an expected call of TestList
+func (_mr *MockThriftTestMockRecorder) TestList(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestList", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestMap(_param0 map[int32]int32) (map[int32]int32, error) {
-	ret := _m.ctrl.Call(_m, "TestMap", _param0)
+// TestMap mocks base method
+func (_m *MockThriftTest) TestMap(_param0 context.Context, _param1 map[int32]int32) (map[int32]int32, error) {
+	ret := _m.ctrl.Call(_m, "TestMap", _param0, _param1)
 	ret0, _ := ret[0].(map[int32]int32)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestMap(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMap", arg0)
+// TestMap indicates an expected call of TestMap
+func (_mr *MockThriftTestMockRecorder) TestMap(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMap", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestMapMap(_param0 int32) (map[int32]map[int32]int32, error) {
-	ret := _m.ctrl.Call(_m, "TestMapMap", _param0)
+// TestMapMap mocks base method
+func (_m *MockThriftTest) TestMapMap(_param0 context.Context, _param1 int32) (map[int32]map[int32]int32, error) {
+	ret := _m.ctrl.Call(_m, "TestMapMap", _param0, _param1)
 	ret0, _ := ret[0].(map[int32]map[int32]int32)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestMapMap(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMapMap", arg0)
+// TestMapMap indicates an expected call of TestMapMap
+func (_mr *MockThriftTestMockRecorder) TestMapMap(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMapMap", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestMulti(_param0 int8, _param1 int32, _param2 int64, _param3 map[int16]string, _param4 thrifttest.Numberz, _param5 thrifttest.UserId) (*thrifttest.Xtruct, error) {
-	ret := _m.ctrl.Call(_m, "TestMulti", _param0, _param1, _param2, _param3, _param4, _param5)
+// TestMulti mocks base method
+func (_m *MockThriftTest) TestMulti(_param0 context.Context, _param1 int8, _param2 int32, _param3 int64, _param4 map[int16]string, _param5 thrifttest.Numberz, _param6 thrifttest.UserId) (*thrifttest.Xtruct, error) {
+	ret := _m.ctrl.Call(_m, "TestMulti", _param0, _param1, _param2, _param3, _param4, _param5, _param6)
 	ret0, _ := ret[0].(*thrifttest.Xtruct)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestMulti(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMulti", arg0, arg1, arg2, arg3, arg4, arg5)
+// TestMulti indicates an expected call of TestMulti
+func (_mr *MockThriftTestMockRecorder) TestMulti(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMulti", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
 }
 
-func (_m *MockThriftTest) TestMultiException(_param0 string, _param1 string) (*thrifttest.Xtruct, error) {
-	ret := _m.ctrl.Call(_m, "TestMultiException", _param0, _param1)
+// TestMultiException mocks base method
+func (_m *MockThriftTest) TestMultiException(_param0 context.Context, _param1 string, _param2 string) (*thrifttest.Xtruct, error) {
+	ret := _m.ctrl.Call(_m, "TestMultiException", _param0, _param1, _param2)
 	ret0, _ := ret[0].(*thrifttest.Xtruct)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestMultiException(arg0, arg1 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMultiException", arg0, arg1)
+// TestMultiException indicates an expected call of TestMultiException
+func (_mr *MockThriftTestMockRecorder) TestMultiException(arg0, arg1, arg2 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestMultiException", arg0, arg1, arg2)
 }
 
-func (_m *MockThriftTest) TestNest(_param0 *thrifttest.Xtruct2) (*thrifttest.Xtruct2, error) {
-	ret := _m.ctrl.Call(_m, "TestNest", _param0)
+// TestNest mocks base method
+func (_m *MockThriftTest) TestNest(_param0 context.Context, _param1 *thrifttest.Xtruct2) (*thrifttest.Xtruct2, error) {
+	ret := _m.ctrl.Call(_m, "TestNest", _param0, _param1)
 	ret0, _ := ret[0].(*thrifttest.Xtruct2)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestNest(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestNest", arg0)
+// TestNest indicates an expected call of TestNest
+func (_mr *MockThriftTestMockRecorder) TestNest(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestNest", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestOneway(_param0 int32) error {
-	ret := _m.ctrl.Call(_m, "TestOneway", _param0)
+// TestOneway mocks base method
+func (_m *MockThriftTest) TestOneway(_param0 context.Context, _param1 int32) error {
+	ret := _m.ctrl.Call(_m, "TestOneway", _param0, _param1)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
-func (_mr *_MockThriftTestRecorder) TestOneway(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestOneway", arg0)
+// TestOneway indicates an expected call of TestOneway
+func (_mr *MockThriftTestMockRecorder) TestOneway(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestOneway", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestSet(_param0 []int32) ([]int32, error) {
-	ret := _m.ctrl.Call(_m, "TestSet", _param0)
+// TestSet mocks base method
+func (_m *MockThriftTest) TestSet(_param0 context.Context, _param1 []int32) ([]int32, error) {
+	ret := _m.ctrl.Call(_m, "TestSet", _param0, _param1)
 	ret0, _ := ret[0].([]int32)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestSet(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestSet", arg0)
+// TestSet indicates an expected call of TestSet
+func (_mr *MockThriftTestMockRecorder) TestSet(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestSet", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestString(_param0 string) (string, error) {
-	ret := _m.ctrl.Call(_m, "TestString", _param0)
+// TestString mocks base method
+func (_m *MockThriftTest) TestString(_param0 context.Context, _param1 string) (string, error) {
+	ret := _m.ctrl.Call(_m, "TestString", _param0, _param1)
 	ret0, _ := ret[0].(string)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestString(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestString", arg0)
+// TestString indicates an expected call of TestString
+func (_mr *MockThriftTestMockRecorder) TestString(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestString", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestStringMap(_param0 map[string]string) (map[string]string, error) {
-	ret := _m.ctrl.Call(_m, "TestStringMap", _param0)
+// TestStringMap mocks base method
+func (_m *MockThriftTest) TestStringMap(_param0 context.Context, _param1 map[string]string) (map[string]string, error) {
+	ret := _m.ctrl.Call(_m, "TestStringMap", _param0, _param1)
 	ret0, _ := ret[0].(map[string]string)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestStringMap(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestStringMap", arg0)
+// TestStringMap indicates an expected call of TestStringMap
+func (_mr *MockThriftTestMockRecorder) TestStringMap(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestStringMap", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestStruct(_param0 *thrifttest.Xtruct) (*thrifttest.Xtruct, error) {
-	ret := _m.ctrl.Call(_m, "TestStruct", _param0)
+// TestStruct mocks base method
+func (_m *MockThriftTest) TestStruct(_param0 context.Context, _param1 *thrifttest.Xtruct) (*thrifttest.Xtruct, error) {
+	ret := _m.ctrl.Call(_m, "TestStruct", _param0, _param1)
 	ret0, _ := ret[0].(*thrifttest.Xtruct)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestStruct(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestStruct", arg0)
+// TestStruct indicates an expected call of TestStruct
+func (_mr *MockThriftTestMockRecorder) TestStruct(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestStruct", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestTypedef(_param0 thrifttest.UserId) (thrifttest.UserId, error) {
-	ret := _m.ctrl.Call(_m, "TestTypedef", _param0)
+// TestTypedef mocks base method
+func (_m *MockThriftTest) TestTypedef(_param0 context.Context, _param1 thrifttest.UserId) (thrifttest.UserId, error) {
+	ret := _m.ctrl.Call(_m, "TestTypedef", _param0, _param1)
 	ret0, _ := ret[0].(thrifttest.UserId)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
-func (_mr *_MockThriftTestRecorder) TestTypedef(arg0 interface{}) *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestTypedef", arg0)
+// TestTypedef indicates an expected call of TestTypedef
+func (_mr *MockThriftTestMockRecorder) TestTypedef(arg0, arg1 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestTypedef", arg0, arg1)
 }
 
-func (_m *MockThriftTest) TestVoid() error {
-	ret := _m.ctrl.Call(_m, "TestVoid")
+// TestVoid mocks base method
+func (_m *MockThriftTest) TestVoid(_param0 context.Context) error {
+	ret := _m.ctrl.Call(_m, "TestVoid", _param0)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
-func (_mr *_MockThriftTestRecorder) TestVoid() *gomock.Call {
-	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestVoid")
+// TestVoid indicates an expected call of TestVoid
+func (_mr *MockThriftTestMockRecorder) TestVoid(arg0 interface{}) *gomock.Call {
+	return _mr.mock.ctrl.RecordCall(_mr.mock, "TestVoid", arg0)
 }
diff --git a/test/go/src/common/printing_handler.go b/test/go/src/common/printing_handler.go
index d4e2be9..c0a2862 100644
--- a/test/go/src/common/printing_handler.go
+++ b/test/go/src/common/printing_handler.go
@@ -1,3 +1,5 @@
+// +build !go1.7
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file
@@ -25,6 +27,8 @@
 	"encoding/hex"
 	. "gen/thrifttest"
 	"time"
+
+	"golang.org/x/net/context"
 )
 
 var PrintingHandler = &printingHandler{}
@@ -32,7 +36,7 @@
 type printingHandler struct{}
 
 // Prints "testVoid()" and returns nothing.
-func (p *printingHandler) TestVoid() (err error) {
+func (p *printingHandler) TestVoid(ctx context.Context) (err error) {
 	fmt.Println("testVoid()")
 	return nil
 }
@@ -43,7 +47,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestString(thing string) (r string, err error) {
+func (p *printingHandler) TestString(ctx context.Context, thing string) (r string, err error) {
 	fmt.Printf("testString(\"%s\")\n", thing)
 	return thing, nil
 }
@@ -54,7 +58,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestBool(thing bool) (r bool, err error) {
+func (p *printingHandler) TestBool(ctx context.Context, thing bool) (r bool, err error) {
 	fmt.Printf("testBool(%t)\n", thing)
 	return thing, nil
 }
@@ -65,7 +69,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestByte(thing int8) (r int8, err error) {
+func (p *printingHandler) TestByte(ctx context.Context, thing int8) (r int8, err error) {
 	fmt.Printf("testByte(%d)\n", thing)
 	return thing, nil
 }
@@ -76,7 +80,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestI32(thing int32) (r int32, err error) {
+func (p *printingHandler) TestI32(ctx context.Context, thing int32) (r int32, err error) {
 	fmt.Printf("testI32(%d)\n", thing)
 	return thing, nil
 }
@@ -87,7 +91,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestI64(thing int64) (r int64, err error) {
+func (p *printingHandler) TestI64(ctx context.Context, thing int64) (r int64, err error) {
 	fmt.Printf("testI64(%d)\n", thing)
 	return thing, nil
 }
@@ -98,7 +102,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestDouble(thing float64) (r float64, err error) {
+func (p *printingHandler) TestDouble(ctx context.Context, thing float64) (r float64, err error) {
 	fmt.Printf("testDouble(%f)\n", thing)
 	return thing, nil
 }
@@ -109,7 +113,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestBinary(thing []byte) (r []byte, err error) {
+func (p *printingHandler) TestBinary(ctx context.Context, thing []byte) (r []byte, err error) {
 	fmt.Printf("testBinary(%s)\n", hex.EncodeToString(thing))
 	return thing, nil
 }
@@ -120,7 +124,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestStruct(thing *Xtruct) (r *Xtruct, err error) {
+func (p *printingHandler) TestStruct(ctx context.Context, thing *Xtruct) (r *Xtruct, err error) {
 	fmt.Printf("testStruct({\"%s\", %d, %d, %d})\n", thing.StringThing, thing.ByteThing, thing.I32Thing, thing.I64Thing)
 	return thing, err
 }
@@ -131,7 +135,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestNest(nest *Xtruct2) (r *Xtruct2, err error) {
+func (p *printingHandler) TestNest(ctx context.Context, nest *Xtruct2) (r *Xtruct2, err error) {
 	thing := nest.StructThing
 	fmt.Printf("testNest({%d, {\"%s\", %d, %d, %d}, %d})\n", nest.ByteThing, thing.StringThing, thing.ByteThing, thing.I32Thing, thing.I64Thing, nest.I32Thing)
 	return nest, nil
@@ -144,7 +148,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestMap(thing map[int32]int32) (r map[int32]int32, err error) {
+func (p *printingHandler) TestMap(ctx context.Context, thing map[int32]int32) (r map[int32]int32, err error) {
 	fmt.Printf("testMap({")
 	first := true
 	for k, v := range thing {
@@ -166,7 +170,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestStringMap(thing map[string]string) (r map[string]string, err error) {
+func (p *printingHandler) TestStringMap(ctx context.Context, thing map[string]string) (r map[string]string, err error) {
 	fmt.Printf("testStringMap({")
 	first := true
 	for k, v := range thing {
@@ -188,7 +192,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestSet(thing []int32) (r []int32, err error) {
+func (p *printingHandler) TestSet(ctx context.Context, thing []int32) (r []int32, err error) {
 	fmt.Printf("testSet({")
 	first := true
 	for k, _ := range thing {
@@ -210,7 +214,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestList(thing []int32) (r []int32, err error) {
+func (p *printingHandler) TestList(ctx context.Context, thing []int32) (r []int32, err error) {
 	fmt.Printf("testList({")
 	for i, v := range thing {
 		if i != 0 {
@@ -228,7 +232,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestEnum(thing Numberz) (r Numberz, err error) {
+func (p *printingHandler) TestEnum(ctx context.Context, thing Numberz) (r Numberz, err error) {
 	fmt.Printf("testEnum(%d)\n", thing)
 	return thing, nil
 }
@@ -239,7 +243,7 @@
 //
 // Parameters:
 //  - Thing
-func (p *printingHandler) TestTypedef(thing UserId) (r UserId, err error) {
+func (p *printingHandler) TestTypedef(ctx context.Context, thing UserId) (r UserId, err error) {
 	fmt.Printf("testTypedef(%d)\n", thing)
 	return thing, nil
 }
@@ -251,7 +255,7 @@
 //
 // Parameters:
 //  - Hello
-func (p *printingHandler) TestMapMap(hello int32) (r map[int32]map[int32]int32, err error) {
+func (p *printingHandler) TestMapMap(ctx context.Context, hello int32) (r map[int32]map[int32]int32, err error) {
 	fmt.Printf("testMapMap(%d)\n", hello)
 
 	r = map[int32]map[int32]int32{
@@ -273,7 +277,7 @@
 //
 // Parameters:
 //  - Argument
-func (p *printingHandler) TestInsanity(argument *Insanity) (r map[UserId]map[Numberz]*Insanity, err error) {
+func (p *printingHandler) TestInsanity(ctx context.Context, argument *Insanity) (r map[UserId]map[Numberz]*Insanity, err error) {
 	fmt.Printf("testInsanity()\n")
 	r = make(map[UserId]map[Numberz]*Insanity)
 	r[1] = map[Numberz]*Insanity {
@@ -303,7 +307,7 @@
 //  - Arg3
 //  - Arg4
 //  - Arg5
-func (p *printingHandler) TestMulti(arg0 int8, arg1 int32, arg2 int64, arg3 map[int16]string, arg4 Numberz, arg5 UserId) (r *Xtruct, err error) {
+func (p *printingHandler) TestMulti(ctx context.Context, arg0 int8, arg1 int32, arg2 int64, arg3 map[int16]string, arg4 Numberz, arg5 UserId) (r *Xtruct, err error) {
 	fmt.Printf("testMulti()\n")
 	r = NewXtruct()
 
@@ -322,7 +326,7 @@
 //
 // Parameters:
 //  - Arg
-func (p *printingHandler) TestException(arg string) (err error) {
+func (p *printingHandler) TestException(ctx context.Context, arg string) (err error) {
 	fmt.Printf("testException(%s)\n", arg)
 	switch arg {
 	case "Xception":
@@ -346,7 +350,7 @@
 // Parameters:
 //  - Arg0
 //  - Arg1
-func (p *printingHandler) TestMultiException(arg0 string, arg1 string) (r *Xtruct, err error) {
+func (p *printingHandler) TestMultiException(ctx context.Context, arg0 string, arg1 string) (r *Xtruct, err error) {
 	fmt.Printf("testMultiException(%s, %s)\n", arg0, arg1)
 	switch arg0 {
 
@@ -375,7 +379,7 @@
 //
 // Parameters:
 //  - SecondsToSleep
-func (p *printingHandler) TestOneway(secondsToSleep int32) (err error) {
+func (p *printingHandler) TestOneway(ctx context.Context, secondsToSleep int32) (err error) {
 	fmt.Printf("testOneway(%d): Sleeping...\n", secondsToSleep)
 	time.Sleep(time.Second * time.Duration(secondsToSleep))
 	fmt.Printf("testOneway(%d): done sleeping!\n", secondsToSleep)
diff --git a/test/go/src/common/printing_handler_go17.go b/test/go/src/common/printing_handler_go17.go
new file mode 100644
index 0000000..1efae86
--- /dev/null
+++ b/test/go/src/common/printing_handler_go17.go
@@ -0,0 +1,386 @@
+// +build go1.7
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package common
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"encoding/hex"
+	. "gen/thrifttest"
+	"time"
+)
+
+var PrintingHandler = &printingHandler{}
+
+type printingHandler struct{}
+
+// Prints "testVoid()" and returns nothing.
+func (p *printingHandler) TestVoid(ctx context.Context) (err error) {
+	fmt.Println("testVoid()")
+	return nil
+}
+
+// Prints 'testString("%s")' with thing as '%s'
+// @param string thing - the string to print
+// @return string - returns the string 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestString(ctx context.Context, thing string) (r string, err error) {
+	fmt.Printf("testString(\"%s\")\n", thing)
+	return thing, nil
+}
+
+// Prints 'testBool("%t")' with thing as 'true' or 'false'
+// @param bool thing - the bool to print
+// @return bool - returns the bool 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestBool(ctx context.Context, thing bool) (r bool, err error) {
+	fmt.Printf("testBool(%t)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testByte("%d")' with thing as '%d'
+// @param byte thing - the byte to print
+// @return byte - returns the byte 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestByte(ctx context.Context, thing int8) (r int8, err error) {
+	fmt.Printf("testByte(%d)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testI32("%d")' with thing as '%d'
+// @param i32 thing - the i32 to print
+// @return i32 - returns the i32 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestI32(ctx context.Context, thing int32) (r int32, err error) {
+	fmt.Printf("testI32(%d)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testI64("%d")' with thing as '%d'
+// @param i64 thing - the i64 to print
+// @return i64 - returns the i64 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestI64(ctx context.Context, thing int64) (r int64, err error) {
+	fmt.Printf("testI64(%d)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testDouble("%f")' with thing as '%f'
+// @param double thing - the double to print
+// @return double - returns the double 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestDouble(ctx context.Context, thing float64) (r float64, err error) {
+	fmt.Printf("testDouble(%f)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testBinary("%s")' where '%s' is a hex-formatted string of thing's data
+// @param []byte thing - the binary to print
+// @return []byte - returns the binary 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestBinary(ctx context.Context, thing []byte) (r []byte, err error) {
+	fmt.Printf("testBinary(%s)\n", hex.EncodeToString(thing))
+	return thing, nil
+}
+
+// Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values
+// @param Xtruct thing - the Xtruct to print
+// @return Xtruct - returns the Xtruct 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestStruct(ctx context.Context, thing *Xtruct) (r *Xtruct, err error) {
+	fmt.Printf("testStruct({\"%s\", %d, %d, %d})\n", thing.StringThing, thing.ByteThing, thing.I32Thing, thing.I64Thing)
+	return thing, err
+}
+
+// Prints 'testNest("{%s}")' where thing has been formatted into a string of the nested struct
+// @param Xtruct2 thing - the Xtruct2 to print
+// @return Xtruct2 - returns the Xtruct2 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestNest(ctx context.Context, nest *Xtruct2) (r *Xtruct2, err error) {
+	thing := nest.StructThing
+	fmt.Printf("testNest({%d, {\"%s\", %d, %d, %d}, %d})\n", nest.ByteThing, thing.StringThing, thing.ByteThing, thing.I32Thing, thing.I64Thing, nest.I32Thing)
+	return nest, nil
+}
+
+// Prints 'testMap("{%s")' where thing has been formatted into a string of  'key => value' pairs
+//  separated by commas and new lines
+// @param map<i32,i32> thing - the map<i32,i32> to print
+// @return map<i32,i32> - returns the map<i32,i32> 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestMap(ctx context.Context, thing map[int32]int32) (r map[int32]int32, err error) {
+	fmt.Printf("testMap({")
+	first := true
+	for k, v := range thing {
+		if first {
+			first = false
+		} else {
+			fmt.Printf(", ")
+		}
+		fmt.Printf("%d => %d", k, v)
+	}
+	fmt.Printf("})\n")
+	return thing, nil
+}
+
+// Prints 'testStringMap("{%s}")' where thing has been formatted into a string of  'key => value' pairs
+//  separated by commas and new lines
+// @param map<string,string> thing - the map<string,string> to print
+// @return map<string,string> - returns the map<string,string> 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestStringMap(ctx context.Context, thing map[string]string) (r map[string]string, err error) {
+	fmt.Printf("testStringMap({")
+	first := true
+	for k, v := range thing {
+		if first {
+			first = false
+		} else {
+			fmt.Printf(", ")
+		}
+		fmt.Printf("%s => %s", k, v)
+	}
+	fmt.Printf("})\n")
+	return thing, nil
+}
+
+// Prints 'testSet("{%s}")' where thing has been formatted into a string of  values
+//  separated by commas and new lines
+// @param set<i32> thing - the set<i32> to print
+// @return set<i32> - returns the set<i32> 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestSet(ctx context.Context, thing []int32) (r []int32, err error) {
+	fmt.Printf("testSet({")
+	first := true
+	for k, _ := range thing {
+		if first {
+			first = false
+		} else {
+			fmt.Printf(", ")
+		}
+		fmt.Printf("%d", k)
+	}
+	fmt.Printf("})\n")
+	return thing, nil
+}
+
+// Prints 'testList("{%s}")' where thing has been formatted into a string of  values
+//  separated by commas and new lines
+// @param list<i32> thing - the list<i32> to print
+// @return list<i32> - returns the list<i32> 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestList(ctx context.Context, thing []int32) (r []int32, err error) {
+	fmt.Printf("testList({")
+	for i, v := range thing {
+		if i != 0 {
+			fmt.Printf(", ")
+		}
+		fmt.Printf("%d", v)
+	}
+	fmt.Printf("})\n")
+	return thing, nil
+}
+
+// Prints 'testEnum("%d")' where thing has been formatted into it's numeric value
+// @param Numberz thing - the Numberz to print
+// @return Numberz - returns the Numberz 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestEnum(ctx context.Context, thing Numberz) (r Numberz, err error) {
+	fmt.Printf("testEnum(%d)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testTypedef("%d")' with thing as '%d'
+// @param UserId thing - the UserId to print
+// @return UserId - returns the UserId 'thing'
+//
+// Parameters:
+//  - Thing
+func (p *printingHandler) TestTypedef(ctx context.Context, thing UserId) (r UserId, err error) {
+	fmt.Printf("testTypedef(%d)\n", thing)
+	return thing, nil
+}
+
+// Prints 'testMapMap("%d")' with hello as '%d'
+// @param i32 hello - the i32 to print
+// @return map<i32,map<i32,i32>> - returns a dictionary with these values:
+//   {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 1, 2 => 2, 3 => 3, 4 => 4, }, }
+//
+// Parameters:
+//  - Hello
+func (p *printingHandler) TestMapMap(ctx context.Context, hello int32) (r map[int32]map[int32]int32, err error) {
+	fmt.Printf("testMapMap(%d)\n", hello)
+
+	r = map[int32]map[int32]int32{
+		-4: map[int32]int32{-4: -4, -3: -3, -2: -2, -1: -1},
+		4:  map[int32]int32{4: 4, 3: 3, 2: 2, 1: 1},
+	}
+	return
+}
+
+// So you think you've got this all worked, out eh?
+//
+// Creates a the returned map with these values and prints it out:
+//   { 1 => { 2 => argument,
+//            3 => argument,
+//          },
+//     2 => { 6 => <empty Insanity struct>, },
+//   }
+// @return map<UserId, map<Numberz,Insanity>> - a map with the above values
+//
+// Parameters:
+//  - Argument
+func (p *printingHandler) TestInsanity(ctx context.Context, argument *Insanity) (r map[UserId]map[Numberz]*Insanity, err error) {
+	fmt.Printf("testInsanity()\n")
+	r = make(map[UserId]map[Numberz]*Insanity)
+	r[1] = map[Numberz]*Insanity {
+		2: argument,
+		3: argument,
+	}
+	r[2] = map[Numberz]*Insanity {
+		6: NewInsanity(),
+	}
+	return
+}
+
+// Prints 'testMulti()'
+// @param byte arg0 -
+// @param i32 arg1 -
+// @param i64 arg2 -
+// @param map<i16, string> arg3 -
+// @param Numberz arg4 -
+// @param UserId arg5 -
+// @return Xtruct - returns an Xtruct with StringThing = "Hello2, ByteThing = arg0, I32Thing = arg1
+//    and I64Thing = arg2
+//
+// Parameters:
+//  - Arg0
+//  - Arg1
+//  - Arg2
+//  - Arg3
+//  - Arg4
+//  - Arg5
+func (p *printingHandler) TestMulti(ctx context.Context, arg0 int8, arg1 int32, arg2 int64, arg3 map[int16]string, arg4 Numberz, arg5 UserId) (r *Xtruct, err error) {
+	fmt.Printf("testMulti()\n")
+	r = NewXtruct()
+
+	r.StringThing = "Hello2"
+	r.ByteThing = arg0
+	r.I32Thing = arg1
+	r.I64Thing = arg2
+	return
+}
+
+// Print 'testException(%s)' with arg as '%s'
+// @param string arg - a string indication what type of exception to throw
+// if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
+// elsen if arg == "TException" throw TException
+// else do not throw anything
+//
+// Parameters:
+//  - Arg
+func (p *printingHandler) TestException(ctx context.Context, arg string) (err error) {
+	fmt.Printf("testException(%s)\n", arg)
+	switch arg {
+	case "Xception":
+		e := NewXception()
+		e.ErrorCode = 1001
+		e.Message = arg
+		return e
+	case "TException":
+		return errors.New("Just TException")
+	}
+	return
+}
+
+// Print 'testMultiException(%s, %s)' with arg0 as '%s' and arg1 as '%s'
+// @param string arg - a string indication what type of exception to throw
+// if arg0 == "Xception" throw Xception with errorCode = 1001 and message = "This is an Xception"
+// elsen if arg0 == "Xception2" throw Xception2 with errorCode = 2002 and message = "This is an Xception2"
+// else do not throw anything
+// @return Xtruct - an Xtruct with StringThing = arg1
+//
+// Parameters:
+//  - Arg0
+//  - Arg1
+func (p *printingHandler) TestMultiException(ctx context.Context, arg0 string, arg1 string) (r *Xtruct, err error) {
+	fmt.Printf("testMultiException(%s, %s)\n", arg0, arg1)
+	switch arg0 {
+
+	case "Xception":
+		e := NewXception()
+		e.ErrorCode = 1001
+		e.Message = "This is an Xception"
+		return nil, e
+	case "Xception2":
+		e := NewXception2()
+		e.ErrorCode = 2002
+		e.StructThing = NewXtruct()
+		e.StructThing.StringThing = "This is an Xception2"
+		return nil, e
+	default:
+		r = NewXtruct()
+		r.StringThing = arg1
+		return
+	}
+}
+
+// Print 'testOneway(%d): Sleeping...' with secondsToSleep as '%d'
+// sleep 'secondsToSleep'
+// Print 'testOneway(%d): done sleeping!' with secondsToSleep as '%d'
+// @param i32 secondsToSleep - the number of seconds to sleep
+//
+// Parameters:
+//  - SecondsToSleep
+func (p *printingHandler) TestOneway(ctx context.Context, secondsToSleep int32) (err error) {
+	fmt.Printf("testOneway(%d): Sleeping...\n", secondsToSleep)
+	time.Sleep(time.Second * time.Duration(secondsToSleep))
+	fmt.Printf("testOneway(%d): done sleeping!\n", secondsToSleep)
+	return
+}
