THRIFT-5358: Add go.mod file to root directory
Client: go
This unblocks the development under go 1.16+, which starts to complain
when there's no go.mod file in any of the directories.
The current approach is certainly not the best solution ever, for
example it does not run the tests under lib/go/test/tests but copy them
into lib/go/test/gopath/src/sometest and run them there instead, but
those improvements can be done in the future in follow up PRs and this
should be a good enough first step to unblock developments.
diff --git a/lib/go/test/fuzz/Makefile.am b/lib/go/test/fuzz/Makefile.am
index 41f8b45..1852c4a 100644
--- a/lib/go/test/fuzz/Makefile.am
+++ b/lib/go/test/fuzz/Makefile.am
@@ -18,19 +18,11 @@
#
gopathfuzz: $(THRIFT) fuzz.go
- $(THRIFT) -r --gen go ../../../../tutorial/tutorial.thrift
- GO111MODULE=on go mod init fuzz
- GO111MODULE=on cd gen-go/shared && go mod init shared
- GO111MODULE=on cd gen-go/tutorial && go mod init tutorial
- GO111MODULE=on go mod edit -replace shared=./gen-go/shared
- GO111MODULE=on go mod edit -replace tutorial=./gen-go/tutorial
- GO111MODULE=on cd ../../../../lib/go/thrift && go mod init github.com/apache/thrift/lib/go/thrift
- GO111MODULE=on go mod edit -replace github.com/apache/thrift/lib/go/thrift=../../../../lib/go/thrift
- GO111MODULE=on go mod tidy
+ $(THRIFT) -r --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/lib/go/test/fuzz/gen-go/$(COMPILER_EXTRAFLAG) ../../../../tutorial/tutorial.thrift
touch gopathfuzz
check: gopathfuzz
- go test -tags gofuzz
+ go test -mod=mod -tags gofuzz
clean-local:
$(RM) -r gopathfuzz gen-go