You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by yu...@apache.org on 2021/03/26 14:57:19 UTC

[thrift] branch master updated: Fix lib/go/test/fuzz for oss-fuzz project

This is an automated email from the ASF dual-hosted git repository.

yuxuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 3761f00  Fix lib/go/test/fuzz for oss-fuzz project
3761f00 is described below

commit 3761f0048d0dcf901b683329b4b29cdbd47708fb
Author: Yuxuan 'fishy' Wang <yu...@reddit.com>
AuthorDate: Thu Mar 25 15:41:53 2021 -0700

    Fix lib/go/test/fuzz for oss-fuzz project
---
 lib/go/test/fuzz/Makefile.am | 4 +++-
 lib/go/test/fuzz/fuzz.go     | 5 +++--
 lib/go/test/fuzz/go.mod      | 9 +++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)

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 @@ 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 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