summaryrefslogtreecommitdiff
path: root/brewget.go
diff options
context:
space:
mode:
Diffstat (limited to 'brewget.go')
-rw-r--r--brewget.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/brewget.go b/brewget.go
index b5c8c8a..5b33b01 100644
--- a/brewget.go
+++ b/brewget.go
@@ -118,14 +118,19 @@ func GetBrewList() []string {
return list
}
-func GetBrewDeps() map[string][]string {
+func GetBrewDeps(useCache bool) map[string][]string {
depmap := map[string][]string{}
// Try reading from cache
const cachepath = "depmap.json"
- cache_data, cache_hit := ReadCache(cachepath, brewDepCacheTTL)
+ var cache_data []byte
+ var cache_hit bool
- if cache_hit {
+ if (useCache) {
+ cache_data, cache_hit = ReadCache(cachepath, brewDepCacheTTL)
+ }
+
+ if cache_hit && useCache {
// if cache hit, decode
err := json.Unmarshal(cache_data, &depmap)
if err != nil {