diff options
author | Catena cyber <35799796+catenacyber@users.noreply.github.com> | 2020-11-21 16:11:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-21 07:11:43 -0800 |
commit | 2db56c41743333db03e811b6687dca05620210d5 (patch) | |
tree | fc2d2ba21d3f39915216ac9158238236922b071b /infra/base-images/base-builder | |
parent | e534f4fecc7c0992b105a79123ec97bb55ae2396 (diff) | |
download | oss-fuzz-2db56c41743333db03e811b6687dca05620210d5.tar.gz |
Golang project uses compile_go_fuzzer script (#4685)
* Golang project uses compile_go_fuzzer script
* Kubernetes project uses compile_go_fuzzer script
* Adds golang to ci covergae builds
* fixup
* Golang coverage with go modules
cf coredns project
Diffstat (limited to 'infra/base-images/base-builder')
-rwxr-xr-x | infra/base-images/base-builder/compile_go_fuzzer | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/infra/base-images/base-builder/compile_go_fuzzer b/infra/base-images/base-builder/compile_go_fuzzer index 5fc8b70f0..c6cc3dd8f 100755 --- a/infra/base-images/base-builder/compile_go_fuzzer +++ b/infra/base-images/base-builder/compile_go_fuzzer @@ -24,7 +24,13 @@ if [[ $# -eq 4 ]]; then fi if [[ $SANITIZER = *coverage* ]]; then - cd $GOPATH/src/$path + if [[ $GO111MODULE = on ]]; then + basemod=`echo $path | cut -d/ -f1-3` + cd $GOPATH/pkg/mod/`go list -m $basemod | sed 's/ /@/'` + cd ./`echo $path | cut -d/ -f4-` + else + cd $GOPATH/src/$path + fi fuzzed_package=`pwd | rev | cut -d'/' -f 1 | rev` cp $GOPATH/ossfuzz_coverage_runner.go ./"${function,,}"_test.go sed -i -e 's/FuzzFunction/'$function'/' ./"${function,,}"_test.go |