Fix lib/go/test/fuzz for oss-fuzz project
diff --git a/lib/go/test/fuzz/Makefile.am b/lib/go/test/fuzz/Makefile.am
index 1852c4a..a6abfc5 100644
--- a/lib/go/test/fuzz/Makefile.am
+++ b/lib/go/test/fuzz/Makefile.am
@@ -18,7 +18,9 @@
#
gopathfuzz: $(THRIFT) fuzz.go
- $(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
+ $(THRIFT) -r --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift$(COMPILER_EXTRAFLAG) ../../../../tutorial/tutorial.thrift
+ cd gen-go/shared && go mod init shared
+ cd gen-go/tutorial && go mod init tutorial
touch gopathfuzz
check: gopathfuzz
diff --git a/lib/go/test/fuzz/fuzz.go b/lib/go/test/fuzz/fuzz.go
index 69b3e4e..cd99d58d 100644
--- a/lib/go/test/fuzz/fuzz.go
+++ b/lib/go/test/fuzz/fuzz.go
@@ -26,8 +26,9 @@
"fmt"
"strconv"
- "github.com/apache/thrift/lib/go/test/fuzz/gen-go/shared"
- "github.com/apache/thrift/lib/go/test/fuzz/gen-go/tutorial"
+ "shared"
+ "tutorial"
+
"github.com/apache/thrift/lib/go/thrift"
)
diff --git a/lib/go/test/fuzz/go.mod b/lib/go/test/fuzz/go.mod
new file mode 100644
index 0000000..efff516
--- /dev/null
+++ b/lib/go/test/fuzz/go.mod
@@ -0,0 +1,9 @@
+module github.com/apache/thrift/lib/go/test/fuzz
+
+go 1.15
+
+replace github.com/apache/thrift => ../../../../
+
+replace shared => ./gen-go/shared
+
+replace tutorial => ./gen-go/tutorial