refactor: use google/wire for cache (#7024)

Signed-off-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Teppei Fukuda
2024-06-27 11:04:01 +04:00
committed by GitHub
parent e9fc3e3397
commit 4be02bab8c
22 changed files with 525 additions and 447 deletions

View File

@@ -62,10 +62,12 @@ func cleanAll(ctx context.Context, opts flag.Options) error {
func cleanScanCache(ctx context.Context, opts flag.Options) error {
log.InfoContext(ctx, "Removing scan cache...")
c, err := cache.New(opts.CacheDir, opts.CacheBackendOptions)
c, cleanup, err := cache.New(opts.CacheOpts())
if err != nil {
return xerrors.Errorf("failed to instantiate cache client: %w", err)
}
defer cleanup()
if err = c.Clear(); err != nil {
return xerrors.Errorf("clear scan cache: %w", err)
}