diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-21 13:57:07 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-21 13:57:07 +0800 |
| commit | c9dd811d81be2433bf5b1de540da639c95a0c7f3 (patch) | |
| tree | 3787e683ea31ed667196f4fc4fb81ab72423e27f /cache.go | |
| parent | 5205a76de15203655f9807578c8b5586f98a82bc (diff) | |
feat: add cache related flags
- `--no-cache` for lookup without caching
- `--clear-cache` to delete all cache files and not look up
Diffstat (limited to 'cache.go')
| -rw-r--r-- | cache.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -35,3 +35,8 @@ func WriteCache(relPath string, data []byte) error { path := CachePath(relPath) return os.WriteFile(path, data, 0o644) } + +func ClearCache() error { + path := CachePath("") + return os.RemoveAll(path) +} |
