diff --git a/.golangci.yml b/.golangci.yml index 167b43cb..aff82713 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -133,7 +133,7 @@ linters: #- prealloc # [premature optimization, but can be used in some cases] finds slice declarations that could potentially be preallocated #- tagalign # checks that struct tags are well aligned #- varnamelen # [great idea, but too many false positives] checks that the length of a variable's name matches its scope - #- wrapcheck # checks that errors returned from external packages are wrapped + - wrapcheck # checks that errors returned from external packages are wrapped #- zerologlint # detects the wrong usage of zerolog that a user forgets to dispatch zerolog.Event ## disabled diff --git a/internal/cache/disk.go b/internal/cache/disk.go index 165a7d84..a16d716c 100644 --- a/internal/cache/disk.go +++ b/internal/cache/disk.go @@ -267,7 +267,7 @@ func (d *Disk) evict() error { err := filepath.Walk(d.config.Root, func(path string, info fs.FileInfo, err error) error { if err != nil { - return err + return errors.WithStack(err) } if info.IsDir() { return nil @@ -275,7 +275,7 @@ func (d *Disk) evict() error { relPath, err := filepath.Rel(d.config.Root, path) if err != nil { - return err + return errors.WithStack(err) } expiresAtBytes, err := xattr.Get(path, expiresAtXAttr) @@ -353,7 +353,7 @@ type diskWriter struct { func (w *diskWriter) Write(p []byte) (int, error) { n, err := w.file.Write(p) w.size += int64(n) - return n, err + return n, errors.WithStack(err) } func (w *diskWriter) Close() error {