From f9e453e66617fe87545d17b9dad77cae1aaf88e9 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 16 Sep 2011 17:56:49 -0700 Subject: [PATCH] add CacheDir to osutil Change-Id: I8f6b1d6c8d1b275d329eeac2d91e15a3582e59fb --- lib/go/camli/osutil/paths.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/go/camli/osutil/paths.go b/lib/go/camli/osutil/paths.go index 5d45bb677..6648b38eb 100644 --- a/lib/go/camli/osutil/paths.go +++ b/lib/go/camli/osutil/paths.go @@ -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