summaryrefslogtreecommitdiffstats
path: root/cache/filecache/filecache_pruner.go
diff options
context:
space:
mode:
Diffstat (limited to 'cache/filecache/filecache_pruner.go')
-rw-r--r--cache/filecache/filecache_pruner.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cache/filecache/filecache_pruner.go b/cache/filecache/filecache_pruner.go
index e5e571972..5734af199 100644
--- a/cache/filecache/filecache_pruner.go
+++ b/cache/filecache/filecache_pruner.go
@@ -18,6 +18,7 @@ import (
"io"
"os"
+ "github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/hugofs"
"github.com/spf13/afero"
@@ -36,7 +37,7 @@ func (c Caches) Prune() (int, error) {
counter += count
if err != nil {
- if os.IsNotExist(err) {
+ if herrors.IsNotExist(err) {
continue
}
return counter, fmt.Errorf("failed to prune cache %q: %w", k, err)
@@ -76,7 +77,7 @@ func (c *Cache) Prune(force bool) (int, error) {
err = c.Fs.Remove(name)
}
- if err != nil && !os.IsNotExist(err) {
+ if err != nil && !herrors.IsNotExist(err) {
return err
}
@@ -97,7 +98,7 @@ func (c *Cache) Prune(force bool) (int, error) {
counter++
}
- if err != nil && !os.IsNotExist(err) {
+ if err != nil && !herrors.IsNotExist(err) {
return err
}
@@ -112,7 +113,7 @@ func (c *Cache) Prune(force bool) (int, error) {
func (c *Cache) pruneRootDir(force bool) (int, error) {
info, err := c.Fs.Stat(c.pruneAllRootDir)
if err != nil {
- if os.IsNotExist(err) {
+ if herrors.IsNotExist(err) {
return 0, nil
}
return 0, err