THRIFT-4855: Pin golang/mock to 1.2.0

The latest version (1.3.0) requires us to switch to Go modules for our
tests, but that's not trivial given our directory structure.

For now, just fix the CI issues by pinning the version.
diff --git a/test/go/Makefile.am b/test/go/Makefile.am
index 6da8339..3cf6a70 100644
--- a/test/go/Makefile.am
+++ b/test/go/Makefile.am
@@ -58,8 +58,7 @@
 	GOPATH=`pwd` $(GO) test -v common/...
 
 genmock: gopath
-	GOPATH=`pwd` $(GO) install github.com/golang/mock/mockgen
-	GOPATH=`pwd` bin/mockgen -destination=src/common/mock_handler.go -package=common gen/thrifttest ThriftTest
+	sh genmock.sh
 
 EXTRA_DIST = \
 	src/bin \
diff --git a/test/go/genmock.sh b/test/go/genmock.sh
new file mode 100644
index 0000000..3ba41b9
--- /dev/null
+++ b/test/go/genmock.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+export GOPATH=`pwd`
+export GOBIN=`pwd`/bin
+export GO111MODULE=off
+
+mkdir -p src/github.com/golang/mock
+cd src/github.com/golang
+curl -fsSL https://github.com/golang/mock/archive/v1.2.0.tar.gz -o mock.tar.gz
+tar -xzvf mock.tar.gz -C mock --strip-components=1
+cd mock/mockgen
+go install .
+cd ../../../../../
+bin/mockgen -destination=src/common/mock_handler.go -package=common gen/thrifttest ThriftTest