Skip to content

Commit

Permalink
Set GOROOT
Browse files Browse the repository at this point in the history
GOROOT was dropped by actions/setup-go#175.

If it is not set then this test fails with:

    --- FAIL: TestGVMRunUse (5.45s)
    --- FAIL: TestGVMRunUse/1.7.4_bash (2.68s)
        use_test.go:54: export GOROOT="/home/runner/.gvm/versions/go1.7.4.linux.amd64"
            export PATH="/home/runner/.gvm/versions/go1.7.4.linux.amd64/bin:$PATH"

        use_test.go:79: failed to run go version: exit status 2
            go: cannot find GOROOT directory: /usr/local/go
  • Loading branch information
andrewkroh committed Aug 3, 2022
1 parent 9b4bd49 commit 72dc8d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/gvm/use_test.go
Expand Up @@ -72,7 +72,10 @@ func TestGVMRunUse(t *testing.T) {
}

// Test that GOROOT/bin/go exists and is the correct version.
version, err := exec.Command(filepath.Join(goroot, "bin", "go"), "version").Output()
goVersionCmd := exec.Command(filepath.Join(goroot, "bin", "go"), "version")
goVersionCmd.Env = append(goVersionCmd.Env, "GOROOT="+goroot)

version, err := goVersionCmd.Output()
if err != nil {
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
Expand Down

0 comments on commit 72dc8d1

Please sign in to comment.