diff options
Diffstat (limited to 'brewget.go')
| -rw-r--r-- | brewget.go | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 { |
