Skip to content

Commit

Permalink
Add naive support for multiple gopaths (fixes #52)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Dec 18, 2017
1 parent bc52cfb commit 9fb62cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **[IMPROVED]** Interactive clone directory prompts now order the options by their distance from the current working directory
- **[IMPROVED]** Interactive clone directory prompts now indicate if one of the options is the current working directory
- **[IMPROVED]** Add `open` as an alias for the `browse` command
- **[FIX]** Naive support for multiple `$GOPATH` directories (grit always used the first one in the list)

## 0.6.8 (2017-12-04)

Expand Down
8 changes: 5 additions & 3 deletions src/grit/pathutil/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package pathutil
import (
"os"
"path"
"path/filepath"
)

// GoPath returns the current user's $GOPATH directory.
func GoPath() (string, error) {
dir := os.Getenv("GOPATH")
if dir != "" {
return dir, nil
p := os.Getenv("GOPATH")
if p != "" {
dirs := filepath.SplitList(p)
return dirs[0], nil
}

home, err := HomeDir()
Expand Down

0 comments on commit 9fb62cb

Please sign in to comment.