()
| 44 | } |
| 45 | |
| 46 | func newDetectionCache() *detectionCache { |
| 47 | return &detectionCache{ |
| 48 | path: filepath.Join(pathutil.CacheDir(), "tools", "detection.json"), |
| 49 | entries: map[string]detectionEntry{}, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // loadOnce reads the on-disk cache into memory the first time it is called. |
| 54 | // Best-effort: a missing or corrupt file leaves the cache empty so callers |