onedrive: report any list errors during cleanup

This commit is contained in:
albertony 2023-03-25 17:28:37 +01:00
parent 432eb74814
commit c1586a9866
2 changed files with 4 additions and 14 deletions

View File

@ -44,20 +44,6 @@ issues:
- staticcheck - staticcheck
text: 'SA6002: argument should be pointer-like to avoid allocations' text: 'SA6002: argument should be pointer-like to avoid allocations'
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
# positive, consider instead excluding this check using a code comment!
- path: ^backend[\\/]onedrive[\\/]onedrive\.go$
linters:
- staticcheck
text: 'SA4009: argument err is overwritten before first use'
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
# positive, consider instead excluding this check using a code comment!
- path: ^backend[\\/]onedrive[\\/]onedrive\.go$
linters:
- staticcheck
text: 'SA4009\(related information\): assignment to err'
# TODO: Investigate if this is a real issue. If not, i.e. it is a false # TODO: Investigate if this is a real issue. If not, i.e. it is a false
# positive, consider instead excluding this check using a code comment! # positive, consider instead excluding this check using a code comment!
- path: ^fs[\\/]pacer\.go$ - path: ^fs[\\/]pacer\.go$

View File

@ -1724,6 +1724,10 @@ func (f *Fs) CleanUp(ctx context.Context) error {
token := make(chan struct{}, f.ci.Checkers) token := make(chan struct{}, f.ci.Checkers)
var wg sync.WaitGroup var wg sync.WaitGroup
err := walk.Walk(ctx, f, "", true, -1, func(path string, entries fs.DirEntries, err error) error { err := walk.Walk(ctx, f, "", true, -1, func(path string, entries fs.DirEntries, err error) error {
if err != nil {
fs.Errorf(f, "Failed to list %q: %v", path, err)
return nil
}
err = entries.ForObjectError(func(obj fs.Object) error { err = entries.ForObjectError(func(obj fs.Object) error {
o, ok := obj.(*Object) o, ok := obj.(*Object)
if !ok { if !ok {