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 // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
23 var installPath = func() string {
24 home, err := getHomeDir()
26 return "/usr/local/go"
29 return filepath.Join(home, ".go")
32 func whichGo(ctx context.Context) (string, error) {
33 return findGo(ctx, "which")
36 func isWindowsXP() bool {
40 func currentShell() string {
41 return os.Getenv("SHELL")
44 func persistEnvChangesForSession() error {
45 shellConfig, err := shellConfigFile()
50 fmt.Printf("One more thing! Run `source %s` to persist the\n", shellConfig)
51 fmt.Println("new environment variables to your current session, or open a")
52 fmt.Println("new shell prompt.")