Skip to content

Commit 38754e7

Browse files
committed
feat: add a variable to override where we install to
1 parent 8165dcd commit 38754e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/version/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ func exe() string {
445445
}
446446

447447
func goroot(version string) (string, error) {
448+
if os.Getenv("GOTOOLCHAINROOT") != "" {
449+
return filepath.Join(os.Getenv("GOTOOLCHAINROOT"), version), nil
450+
}
448451
home, err := homedir()
449452
if err != nil {
450453
return "", fmt.Errorf("failed to get home directory: %v", err)

0 commit comments

Comments
 (0)