summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYuxuan 'fishy' Wang <yuxuan.wang@reddit.com>2022-04-19 14:31:39 -0700
committerYuxuan 'fishy' Wang <fishywang@gmail.com>2022-04-25 16:00:53 -0700
commit8045d82f0d5359cbdc196414f0c1aa4679c4124f (patch)
tree29782b3cd2b3d27a4704dad3b57f47f6cf22bd8f /test
parent88a45ac77518eafb57db08938ecdf38c5fcf7a31 (diff)
downloadthrift-8045d82f0d5359cbdc196414f0c1aa4679c4124f.tar.gz
Update Go versions used in travis and LANGUAGES.md
Per our support policy, drop support of go 1.16 and add support of go 1.18. Also enable go vet in make check, and fix issues reported by go vet.
Diffstat (limited to 'test')
-rw-r--r--test/go/Makefile.am12
-rw-r--r--test/go/genmock.sh2
2 files changed, 10 insertions, 4 deletions
diff --git a/test/go/Makefile.am b/test/go/Makefile.am
index d7db957af..ef00df3a2 100644
--- a/test/go/Makefile.am
+++ b/test/go/Makefile.am
@@ -19,6 +19,12 @@
BUILT_SOURCES = gopath
+if GOVERSION_GE_118
+GOINSTALLEXTRA = -buildvcs=false
+else
+GOINSTALLEXTRA =
+endif
+
THRIFTCMD = $(THRIFT) -out src/gen --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/test/go/src/gen/$(COMPILER_EXTRAFLAG)
THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
@@ -37,13 +43,13 @@ gopath: $(THRIFT) ThriftTest.thrift
touch gopath
bin/testclient: gopath
- GOPATH=`pwd` $(GO) install -mod=mod ./src/bin/testclient
+ GOPATH=`pwd` $(GO) install $(GOINSTALLEXTRA) -mod=mod ./src/bin/testclient
bin/testserver: gopath
- GOPATH=`pwd` $(GO) install -mod=mod ./src/bin/testserver
+ GOPATH=`pwd` $(GO) install $(GOINSTALLEXTRA) -mod=mod ./src/bin/testserver
bin/stress: gopath
- GOPATH=`pwd` $(GO) install -mod=mod ./src/bin/stress
+ GOPATH=`pwd` $(GO) install $(GOINSTALLEXTRA) -mod=mod ./src/bin/stress
clean-local:
$(RM) -r src/gen src/github.com/golang src/thrift bin pkg gopath ThriftTest.thrift
diff --git a/test/go/genmock.sh b/test/go/genmock.sh
index 4958783d0..9bd2a3ca7 100644
--- a/test/go/genmock.sh
+++ b/test/go/genmock.sh
@@ -4,7 +4,7 @@ set -e
export GOPATH=$(mktemp -d -t gopath-XXXXXXXXXX)
-GO111MODULE=on go install -mod=mod github.com/golang/mock/mockgen
+go install -mod=mod github.com/golang/mock/mockgen
`go env GOPATH`/bin/mockgen -build_flags "-mod=mod" -destination=src/common/mock_handler.go -package=common github.com/apache/thrift/test/go/src/gen/thrifttest ThriftTest