From 38754e7a0ae980b363126bad5229d8ccbf17aeaa Mon Sep 17 00:00:00 2001 From: Aaron France Date: Mon, 20 Nov 2023 12:59:27 +0100 Subject: [PATCH] feat: add a variable to override where we install to --- internal/version/version.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/version/version.go b/internal/version/version.go index e8bab694..cb6483a7 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -445,6 +445,9 @@ func exe() string { } func goroot(version string) (string, error) { + if os.Getenv("GOTOOLCHAINROOT") != "" { + return filepath.Join(os.Getenv("GOTOOLCHAINROOT"), version), nil + } home, err := homedir() if err != nil { return "", fmt.Errorf("failed to get home directory: %v", err)