save persists the given entries snapshot to disk atomically. Best-effort.
(entries map[string]*resolutionCacheEntry)
| 136 | if !strings.Contains(k, "#") { |
| 137 | snapshot[k] = v |
| 138 | } |
| 139 | } |
| 140 | c.mu.Unlock() |
| 141 | |
| 142 | c.save(snapshot) |
| 143 | } |
| 144 | |
| 145 | // load reads the cache from disk. Best-effort: errors are silently ignored. |
| 146 | func (c *GitHubResolutionCache) load() { |
| 147 | data, err := os.ReadFile(c.filePath) |
| 148 | if err != nil { |
| 149 | return |
| 150 | } |
| 151 | var f resolutionCacheFile |
| 152 | if err := json.Unmarshal(data, &f); err != nil { |
no test coverage detected