aboutsummaryrefslogtreecommitdiff
path: root/internal/dup
diff options
context:
space:
mode:
Diffstat (limited to 'internal/dup')
-rw-r--r--internal/dup/dup.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/dup/dup.go b/internal/dup/dup.go
index 32bcfb0..042aea8 100644
--- a/internal/dup/dup.go
+++ b/internal/dup/dup.go
@@ -108,14 +108,14 @@ func (x *Index) addExtraDir(dir string) []error {
if path == dir {
return err
}
- errs = append(errs, fmt.Errorf("%s: %w", path, err))
+ errs = append(errs, CandidateError{Path: path, Err: err})
return nil
}
if path == dir && d.Type()&fs.ModeSymlink != 0 {
// filepath.WalkDir Lstats its root: a symlinked extra directory
// (A4) would otherwise be silently treated as empty rather than
// followed, with no sign anything was wrong.
- errs = append(errs, fmt.Errorf("%s is a symlink; not followed", path))
+ errs = append(errs, CandidateError{Path: path, Err: errors.New("a symlink; not followed")})
return nil
}
if d.Type()&fs.ModeSymlink != 0 || d.IsDir() || !d.Type().IsRegular() {
@@ -125,7 +125,7 @@ func (x *Index) addExtraDir(dir string) []error {
return nil
})
if err != nil {
- errs = append(errs, fmt.Errorf("%s: %w", dir, err))
+ errs = append(errs, CandidateError{Path: dir, Err: err})
}
return errs
}
@@ -141,7 +141,7 @@ func (x *Index) addEntry(path string, d fs.DirEntry, errs *[]error) {
info, err := d.Info()
if err != nil {
if !errors.Is(err, fs.ErrNotExist) {
- *errs = append(*errs, fmt.Errorf("%s: %w", path, err))
+ *errs = append(*errs, CandidateError{Path: path, Err: err})
}
return
}