1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:58:34 -06:00

internal/testenv: handle GOPACKAGESDRIVER=off in NeedsGopackage

This was causing tests to report that they required a binary
called "off".

Change-Id: I592109029c86af20d48d2ee9989d4a25fdb11b3d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194978
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
Rebecca Stambler 2019-09-12 02:42:35 -04:00
parent 22c3443cad
commit b0a6c2aa3f

View File

@ -75,7 +75,11 @@ func NeedsGoPackages(t Testing) {
}
tool := os.Getenv("GOPACKAGESDRIVER")
if tool == "" {
switch tool {
case "off":
// "off" forces go/packages to use the go command.
tool = "go"
case "":
if _, err := exec.LookPath("gopackagesdriver"); err == nil {
tool = "gopackagesdriver"
} else {