MCPcopy Create free account
hub / github.com/astercloud/aster / deleteFromFile

Method deleteFromFile

pkg/tools/cache.go:377–383  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

375}
376
377func (c *ToolCache) deleteFromFile(key string) error {
378 filePath := c.getCacheFilePath(key)
379 if err := os.Remove(filePath); err != nil && !os.IsNotExist(err) {
380 return fmt.Errorf("failed to delete cache file: %w", err)
381 }
382 return nil
383}
384
385func (c *ToolCache) getCacheFilePath(key string) string {
386 return filepath.Join(c.config.CacheDir, key+".json")

Callers 1

DeleteMethod · 0.95

Calls 2

getCacheFilePathMethod · 0.95
RemoveMethod · 0.45

Tested by

no test coverage detected