Fixed unit test failures when GOROOT was unset

This commit is contained in:
Ian Howell
2019-06-20 16:35:38 -05:00
parent 42ef4fbcc1
commit b8423d0f5f

View File

@@ -21,6 +21,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"runtime"
"strings" "strings"
"time" "time"
@@ -89,7 +90,7 @@ func (b *Compiler) SrcRoot() string {
} }
func goBin() string { func goBin() string {
return filepath.Join(os.Getenv("GOROOT"), "bin", "go") return filepath.Join(runtime.GOROOT(), "bin", "go")
} }
// Compile reads ${srcRoot}/${g}/${v}/${k}.go // Compile reads ${srcRoot}/${g}/${v}/${k}.go