Skip to content

Commit

Permalink
internal/testenv: handle GOPACKAGESDRIVER=off in NeedsGopackage
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Michael Matloob <[email protected]>
  • Loading branch information
stamblerre committed Sep 12, 2019
1 parent 22c3443 commit b0a6c2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b0a6c2a

Please sign in to comment.