Skip to content

Commit b0a6c2a

Browse files
committed
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 <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
1 parent 22c3443 commit b0a6c2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/testenv/testenv.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ func NeedsGoPackages(t Testing) {
7575
}
7676

7777
tool := os.Getenv("GOPACKAGESDRIVER")
78-
if tool == "" {
78+
switch tool {
79+
case "off":
80+
// "off" forces go/packages to use the go command.
81+
tool = "go"
82+
case "":
7983
if _, err := exec.LookPath("gopackagesdriver"); err == nil {
8084
tool = "gopackagesdriver"
8185
} else {

0 commit comments

Comments
 (0)