diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eddef62..b150d299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt --- +## [v0.12.2] + +### Fixed + +- Error in `go mod tidy` with `GO111MODULE=off` ([436]((https://github.com/cucumber/godog/pull/436) - [vearutop]) + ## [v0.12.1] ### Fixed @@ -196,6 +202,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt +[v0.12.2]: https://github.com/cucumber/godog/compare/v0.12.1...v0.12.2 [v0.12.1]: https://github.com/cucumber/godog/compare/v0.12.0...v0.12.1 [v0.12.0]: https://github.com/cucumber/godog/compare/v0.11.0...v0.12.0 [v0.11.0]: https://github.com/cucumber/godog/compare/v0.10.0...v0.11.0 diff --git a/internal/builder/builder.go b/internal/builder/builder.go index 88ebd988..1514739c 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -127,9 +127,11 @@ func Build(bin string) error { // we also print back the temp WORK directory // go has built. We will reuse it for our suite workdir. temp := fmt.Sprintf(filepath.Join("%s", "temp-%d.test"), os.TempDir(), time.Now().UnixNano()) - modTidyOutput, err := exec.Command("go", "mod", "tidy").CombinedOutput() - if err != nil { - return fmt.Errorf("failed to tidy modules in tested package: %s, reason: %v, output: %s", abs, err, string(modTidyOutput)) + if os.Getenv("GO111MODULE") != "off" { + modTidyOutput, err := exec.Command("go", "mod", "tidy").CombinedOutput() + if err != nil { + return fmt.Errorf("failed to tidy modules in tested package: %s, reason: %v, output: %s", abs, err, string(modTidyOutput)) + } } testOutput, err := exec.Command("go", "test", "-c", "-work", "-o", temp).CombinedOutput() if err != nil {