1 // Copyright 2017 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 //go:build aix || darwin || dragonfly || freebsd || linux || nacl || netbsd || openbsd || solaris
6 // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
24 var installPath = func() string {
25 home, err := getHomeDir()
27 return "/usr/local/go"
30 return filepath.Join(home, ".go")
33 func whichGo(ctx context.Context) (string, error) {
34 return findGo(ctx, "which")
37 func isWindowsXP() bool {
41 func currentShell() string {
42 return os.Getenv("SHELL")
45 func persistEnvChangesForSession() error {
46 shellConfig, err := shellConfigFile()
51 fmt.Printf("One more thing! Run `source %s` to persist the\n", shellConfig)
52 fmt.Println("new environment variables to your current session, or open a")
53 fmt.Println("new shell prompt.")