add CacheDir to osutil

Change-Id: I8f6b1d6c8d1b275d329eeac2d91e15a3582e59fb
This commit is contained in:
Brad Fitzpatrick 2011-09-16 17:56:49 -07:00
parent e1bb80e41e
commit f9e453e666
1 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,13 @@ func HomeDir() string {
return os.Getenv("HOME")
}
func CacheDir() string {
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
panic("CacheDir not implemented on OS == " + runtime.GOOS)
}
return filepath.Join(HomeDir(), ".cache")
}
func CamliConfigDir() string {
if p := os.Getenv("CAMLI_CONFIG_DIR"); p != "" {
return p