Skip to content

Commit

Permalink
go-fuzz-build: respect GO111MODULE if set
Browse files Browse the repository at this point in the history
This is an alternative to dvyukov#271.

Updates dvyukov#195
  • Loading branch information
josharian committed Oct 3, 2019
1 parent 3901820 commit da0573d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion go-fuzz-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ 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")
// Until we have proper module support, disable modules.
// However, if a user has explicitly set GO111MODULE,
// assume they know what they're doing, and respect it.
if _, ok := os.LookupEnv("GO111MODULE"); !ok {
cfg.Env = append(os.Environ(), "GO111MODULE=off")
}
return cfg
}

Expand Down

0 comments on commit da0573d

Please sign in to comment.