aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/gomega/gexec/build.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/onsi/gomega/gexec/build.go')
-rw-r--r--vendor/github.com/onsi/gomega/gexec/build.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/vendor/github.com/onsi/gomega/gexec/build.go b/vendor/github.com/onsi/gomega/gexec/build.go
index 576fc8ee4..0ddb21076 100644
--- a/vendor/github.com/onsi/gomega/gexec/build.go
+++ b/vendor/github.com/onsi/gomega/gexec/build.go
@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"go/build"
- "io/ioutil"
"os"
"os/exec"
"path"
@@ -14,6 +13,8 @@ import (
"runtime"
"strings"
"sync"
+
+ "github.com/onsi/gomega/internal/gutil"
)
var (
@@ -82,11 +83,11 @@ func CompileTest(packagePath string, args ...string) (compiledPath string, err e
GetAndCompileTest is identical to CompileTest but `go get` the package before compiling tests.
*/
func GetAndCompileTest(packagePath string, args ...string) (compiledPath string, err error) {
- if err := getForTest(build.Default.GOPATH, packagePath, nil); err != nil {
+ if err := getForTest(build.Default.GOPATH, packagePath, []string{"GO111MODULE=off"}); err != nil {
return "", err
}
- return doCompileTest(build.Default.GOPATH, packagePath, nil, args...)
+ return doCompileTest(build.Default.GOPATH, packagePath, []string{"GO111MODULE=off"}, args...)
}
/*
@@ -100,11 +101,11 @@ func CompileTestWithEnvironment(packagePath string, env []string, args ...string
GetAndCompileTestWithEnvironment is identical to GetAndCompileTest but allows you to specify env vars to be set at build time.
*/
func GetAndCompileTestWithEnvironment(packagePath string, env []string, args ...string) (compiledPath string, err error) {
- if err := getForTest(build.Default.GOPATH, packagePath, env); err != nil {
+ if err := getForTest(build.Default.GOPATH, packagePath, append(env, "GO111MODULE=off")); err != nil {
return "", err
}
- return doCompileTest(build.Default.GOPATH, packagePath, env, args...)
+ return doCompileTest(build.Default.GOPATH, packagePath, append(env, "GO111MODULE=off"), args...)
}
/*
@@ -118,11 +119,11 @@ func CompileTestIn(gopath string, packagePath string, args ...string) (compiledP
GetAndCompileTestIn is identical to GetAndCompileTest but allows you to specify a custom $GOPATH (the first argument).
*/
func GetAndCompileTestIn(gopath string, packagePath string, args ...string) (compiledPath string, err error) {
- if err := getForTest(gopath, packagePath, nil); err != nil {
+ if err := getForTest(gopath, packagePath, []string{"GO111MODULE=off"}); err != nil {
return "", err
}
- return doCompileTest(gopath, packagePath, nil, args...)
+ return doCompileTest(gopath, packagePath, []string{"GO111MODULE=off"}, args...)
}
func isLocalPackage(packagePath string) bool {
@@ -222,11 +223,11 @@ func temporaryDirectory() (string, error) {
mu.Lock()
defer mu.Unlock()
if tmpDir == "" {
- tmpDir, err = ioutil.TempDir("", "gexec_artifacts")
+ tmpDir, err = gutil.MkdirTemp("", "gexec_artifacts")
if err != nil {
return "", err
}
}
- return ioutil.TempDir(tmpDir, "g")
+ return gutil.MkdirTemp(tmpDir, "g")
}