From b8423d0f5ffffea4c0c199318d68baab1be201f9 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Thu, 20 Jun 2019 16:35:38 -0500 Subject: [PATCH] Fixed unit test failures when GOROOT was unset --- pkg/plugins/compiler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/plugins/compiler.go b/pkg/plugins/compiler.go index 2ae69507e..515618a81 100644 --- a/pkg/plugins/compiler.go +++ b/pkg/plugins/compiler.go @@ -21,6 +21,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strings" "time" @@ -89,7 +90,7 @@ func (b *Compiler) SrcRoot() 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