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)