1 testenv: look for "go" executable in path. 2 3 --- src/go/build/deps_test.go 4 +++ src/go/build/deps_test.go 5 @@ -168,7 +168,7 @@ var pkgDeps = map[string][]string{ 6 "testing": {"L2", "flag", "fmt", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"}, 7 "testing/iotest": {"L2", "log"}, 8 "testing/quick": {"L2", "flag", "fmt", "reflect"}, 9 - "internal/testenv": {"L2", "os", "testing"}, 10 + "internal/testenv": {"L2", "os", "os/exec", "testing"}, 11 12 // L4 is defined as L3+fmt+log+time, because in general once 13 // you're using L3 packages, use of fmt, log, or time is not a big deal. 14 --- src/internal/testenv/testenv.go 15 +++ src/internal/testenv/testenv.go 16 @@ -12,6 +12,7 @@ package testenv 17 18 import ( 19 "os" 20 + "os/exec" 21 "runtime" 22 "strings" 23 "testing" 24 @@ -36,6 +37,9 @@ func HasGoBuild() bool { 25 return false 26 } 27 } 28 + if _, err := exec.LookPath("go"); err != nil { 29 + return false 30 + } 31 return true 32 } 33 34