Use multi-module to cleanup top level go.mod
Client: go
The go library itself does not have any third-party dependencies. We
have one third party dependency from the test code, which kind of
polluted from top-level go.mod file to the users of thrift go library.
We previous tried to clean that up by creating go.mod file at
lib/go/thrift, which caused issues to the release process and thus
reverted.
Use multi-module to separate tests requiring mock to their own modules
so that we can keep the top-level go.mod file clean.
Also some minor fixes on the github actions go workflow.
diff --git a/lib/go/test/Makefile.am b/lib/go/test/Makefile.am
index b9c00d9..663b42e 100644
--- a/lib/go/test/Makefile.am
+++ b/lib/go/test/Makefile.am
@@ -17,16 +17,12 @@
# under the License.
#
-if GOVERSION_GE_118
GOBUILDEXTRA = -buildvcs=false
-else
-GOBUILDEXTRA =
-endif
THRIFT_GO_ARGS_BASE = thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/lib/go/test/gopath/src/
THRIFTARGS = -out gopath/src/ --gen go:$(THRIFT_GO_ARGS_BASE)$(COMPILER_EXTRAFLAG)
-THRIFTTEST = $(top_srcdir)/test/v0.16/ThriftTest.thrift
+THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
THRIFTARGS_SKIP_REMOTE = -out gopath/src/ --gen go:skip_remote,$(THRIFT_GO_ARGS_BASE)$(COMPILER_EXTRAFLAG)
@@ -105,7 +101,7 @@
touch gopath
check: gopath
- $(GO) build $(GOBUILDEXTRA) -mod=mod \
+ $(GO) build $(GOBUILDEXTRA) \
./gopath/src/includestest \
./gopath/src/binarykeytest \
./gopath/src/servicestest \
@@ -126,14 +122,14 @@
./gopath/src/processormiddlewaretest \
./gopath/src/clientmiddlewareexceptiontest \
./gopath/src/validatetest
- $(GO) test -mod=mod github.com/apache/thrift/lib/go/thrift
- $(GO) test -mod=mod ./gopath/src/tests ./gopath/src/dontexportrwtest
+ $(GO) test github.com/apache/thrift/lib/go/thrift
+ $(GO) test ./gopath/src/tests ./gopath/src/dontexportrwtest
clean-local:
$(RM) -r gopath ThriftTest.thrift gen-go
client: stubs
- $(GO) run -mod=mod TestClient.go
+ $(GO) run TestClient.go
EXTRA_DIST = \
dontexportrwtest \