From 144c82e47f31e5b9dd8de41702ad62be748c7a53 Mon Sep 17 00:00:00 2001 From: Sasha Melentyev Date: Sun, 10 Jul 2022 21:44:49 +0300 Subject: [PATCH] dev: change err to nil (#2971) --- pkg/commands/cache.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/commands/cache.go b/pkg/commands/cache.go index ac3a3ee63fcc..904c2a1fc5c1 100644 --- a/pkg/commands/cache.go +++ b/pkg/commands/cache.go @@ -73,11 +73,8 @@ func (e *Executor) executeCacheStatus(_ *cobra.Command, args []string) { func dirSizeBytes(path string) (int64, error) { var size int64 err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if !info.IsDir() { - size += info.Size() + if err == nil && !info.IsDir() { + size = info.Size() } return err })