Verified Commit 1a717638 authored by meskio's avatar meskio 🏗
Browse files

Don't save the lock into the cache file

This will change the cache file format and a migration will be needed.
parent 3830fa8a
......@@ -85,7 +85,7 @@ func (tc *TestCache) WriteToDisk(cacheFile string) error {
enc := gob.NewEncoder(fh)
tc.l.Lock()
err = enc.Encode(*tc)
err = enc.Encode(tc.Entries)
if err == nil {
log.Printf("Wrote cache with %d elements to %q.",
len((*tc).Entries), cacheFile)
......@@ -106,7 +106,7 @@ func (tc *TestCache) ReadFromDisk(cacheFile string) error {
dec := gob.NewDecoder(fh)
tc.l.Lock()
err = dec.Decode(tc)
err = dec.Decode(&tc.Entries)
if err == nil {
log.Printf("Read cache with %d elements from %q.",
len((*tc).Entries), cacheFile)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment