]> git.lizzy.rs Git - go-anidb.git/commitdiff
anidb: panic if the default cache dir can't be set
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Sun, 14 Jul 2013 15:41:29 +0000 (12:41 -0300)
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>
Sun, 14 Jul 2013 15:41:29 +0000 (12:41 -0300)
Nothing works without a valid cache.

cache.go

index c22199fd0f8340bf20bbe74aebf20c429c5f206d..fff97cbef2cf04b714d65c525c871c807cdfcf28 100644 (file)
--- a/cache.go
+++ b/cache.go
@@ -45,7 +45,9 @@ type cacheDir struct {
 }
 
 func init() {
-       SetCacheDir(path.Join(os.TempDir(), "anidb", "cache"))
+       if err := SetCacheDir(path.Join(os.TempDir(), "anidb", "cache")); err != nil {
+               panic(err)
+       }
 }
 
 var cache cacheDir