mirror of
https://github.com/golang/go
synced 2024-11-18 16:44:43 -07: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:
parent
22c3443cad
commit
b0a6c2aa3f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user