Save writes the cache as JSON.
(path string)
| 34 | |
| 35 | // Save writes the cache as JSON. |
| 36 | func (c *Cache) Save(path string) error { |
| 37 | data, err := json.Marshal(c) |
| 38 | if err != nil { |
| 39 | return err |
| 40 | } |
| 41 | return os.WriteFile(path, data, 0o644) |
| 42 | } |
| 43 | |
| 44 | // ScanFile returns the rollup for a jsonl file, reusing the cached result |
| 45 | // when the file's mod time and size are unchanged. |
no outgoing calls