From: Diogo Franco (Kovensky) Date: Sun, 14 Jul 2013 15:41:29 +0000 (-0300) Subject: anidb: panic if the default cache dir can't be set X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=640f339d3840605d1d77740ebde64352d2c2a10e;p=go-anidb.git anidb: panic if the default cache dir can't be set Nothing works without a valid cache. --- diff --git a/cache.go b/cache.go index c22199f..fff97cb 100644 --- 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