Skip to content

Commit

Permalink
Add opt-in go-fuzz modules support
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevgeny Pats committed Oct 7, 2019
1 parent 3901820 commit 703c4f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion go-fuzz-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ func makeTags() string {
// that clients can then modify and use for calls to go/packages.
func basePackagesConfig() *packages.Config {
cfg := new(packages.Config)
cfg.Env = append(os.Environ(), "GO111MODULE=off")
goFuzzModule, isGoFuzzModuleSet := os.LookupEnv("GOFUZZ111MODULE")

if isGoFuzzModuleSet {
cfg.Env = append(os.Environ(), "GO111MODULE=" + goFuzzModule)
} else {
cfg.Env = append(os.Environ(), "GO111MODULE=off")
}
return cfg
}

Expand Down

0 comments on commit 703c4f1

Please sign in to comment.