Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
language - {fallback => default} for cachedir
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas committed Dec 2, 2017
1 parent 4698075 commit 71e2117
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/dep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (c *Config) Run() int {
}

// Cachedir is loaded from env if present. `$GOPATH/pkg/dep` is used as the
// fallback cache location.
// default cache location.
cachedir := getEnv(c.Env, "DEPCACHEDIR")
if cachedir != "" {
if err := fs.EnsureDir(cachedir, 0777); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func defaultGOPATH() string {
func (c *Ctx) SourceManager() (*gps.SourceMgr, error) {
cachedir := c.Cachedir
if cachedir == "" {
// When `DEPCACHEDIR` isn't set in the env, fallback to `$GOPATH/pkg/dep`.
// When `DEPCACHEDIR` isn't set in the env, use the default - `$GOPATH/pkg/dep`.
cachedir = filepath.Join(c.GOPATH, "pkg", "dep")
}

Expand Down
2 changes: 1 addition & 1 deletion context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func TestDepCachedir(t *testing.T) {
defer h.Cleanup()

h.TempDir("cache")
// Create the directory for fallback cachedir location.
// Create the directory for default cachedir location.
h.TempDir(filepath.Join("go", "pkg", "dep"))

testCachedir := h.Path("cache")
Expand Down

0 comments on commit 71e2117

Please sign in to comment.