cache: Correctly return dir for Windows/darwin

This commit is contained in:
Alexander Neumann 2017-11-20 06:11:18 +01:00
parent fe1f151ae1
commit ea593fca1b
1 changed files with 8 additions and 2 deletions

10
internal/cache/dir.go vendored
View File

@ -56,10 +56,16 @@ func DefaultDir() (cachedir string, err error) {
cachedir, err = darwinCacheDir()
case "windows":
cachedir, err = windowsCacheDir()
default:
// Default to XDG for Linux and any other OSes.
cachedir, err = xdgCacheDir()
}
// Default to XDG for Linux and any other OSes.
return xdgCacheDir()
if err != nil {
return "", err
}
return cachedir, nil
}
func mkdirCacheDir(cachedir string) error {