summaryrefslogtreecommitdiff
path: root/lib/go
diff options
context:
space:
mode:
authorYuxuan 'fishy' Wang <yuxuan.wang@reddit.com>2021-03-25 15:41:53 -0700
committerYuxuan 'fishy' Wang <fishywang@gmail.com>2021-03-26 07:57:09 -0700
commit3761f0048d0dcf901b683329b4b29cdbd47708fb (patch)
tree49abfd1a7bd46119de50807742bbe97c2509df2c /lib/go
parentb87873222a509f5c6ba07e9d7c78d7b20909f805 (diff)
downloadthrift-3761f0048d0dcf901b683329b4b29cdbd47708fb.tar.gz
Fix lib/go/test/fuzz for oss-fuzz project
Diffstat (limited to 'lib/go')
-rw-r--r--lib/go/test/fuzz/Makefile.am4
-rw-r--r--lib/go/test/fuzz/fuzz.go5
-rw-r--r--lib/go/test/fuzz/go.mod9
3 files changed, 15 insertions, 3 deletions
diff --git a/lib/go/test/fuzz/Makefile.am b/lib/go/test/fuzz/Makefile.am
index 1852c4a6a..a6abfc57f 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 69b3e4eb3..cd99d58de 100644
--- a/lib/go/test/fuzz/fuzz.go
+++ b/lib/go/test/fuzz/fuzz.go
@@ -26,8 +26,9 @@ import (
"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 000000000..efff51688
--- /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