From 5e9fe2aebbd51439aa2eeeddaa2c8d70adaa791a Mon Sep 17 00:00:00 2001 From: mircearoata Date: Fri, 2 Feb 2024 00:34:22 +0100 Subject: [PATCH] fix: load cache integrity as plain map (#60) --- cli/cache/integrity.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/cache/integrity.go b/cli/cache/integrity.go index f60d7bf..42212c1 100644 --- a/cli/cache/integrity.go +++ b/cli/cache/integrity.go @@ -87,10 +87,15 @@ func loadHashCache() { return } - if err := json.Unmarshal(hashCacheJSON, &hashCache); err != nil { + var plainCache map[string]hashInfo + if err := json.Unmarshal(hashCacheJSON, &plainCache); err != nil { slog.Warn("failed to unmarshal hash cache, recreating", slog.Any("err", err)) return } + + for k, v := range plainCache { + hashCache.Store(k, v) + } } func saveHashCache() {