We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 45ee47a + 8404549 commit 6ab8f31Copy full SHA for 6ab8f31
pkg/traverse/golang.go
@@ -8,6 +8,10 @@ import (
8
9
// GoBinDir TODO experimental
10
func GoBinDir(tc Context) (dir string, err error) {
11
+ if path, ok := tc.LookupEnv("GOBIN"); ok {
12
+ return filepath.ToSlash(path), nil
13
+ }
14
+
15
if path, ok := tc.LookupEnv("GOPATH"); ok {
16
dir = strings.Split(path, string(os.PathListSeparator))[0]
17
}
@@ -16,8 +20,8 @@ func GoBinDir(tc Context) (dir string, err error) {
20
if dir, err = UserHomeDir(tc); err != nil {
21
return "", err
18
22
19
- dir += "/go"
23
+ dir = filepath.Join(dir, "go")
24
25
- return filepath.ToSlash(dir) + "/bin", nil
26
+ return filepath.ToSlash(filepath.Join(dir, "bin")), nil
27
0 commit comments