Clear cache (fanal#8)

This commit is contained in:
Teppei Fukuda
2019-05-07 21:32:06 +09:00
committed by GitHub
parent c0563f81bc
commit 1778abe4e3
3 changed files with 38 additions and 10 deletions

View File

@@ -1,5 +1,19 @@
package utils
import (
"os"
"path/filepath"
)
func CacheDir() string {
cacheDir, err := os.UserCacheDir()
if err != nil {
cacheDir = os.TempDir()
}
dir := filepath.Join(cacheDir, "fanal")
return dir
}
func StringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {