From c1586a986609d7410dab5e62cc5a70765d73e0ef Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Sat, 25 Mar 2023 17:28:37 +0100 Subject: [PATCH] onedrive: report any list errors during cleanup --- .golangci.yml | 14 -------------- backend/onedrive/onedrive.go | 4 ++++ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5352490bc..55de4e945 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,20 +44,6 @@ issues: - staticcheck 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 # positive, consider instead excluding this check using a code comment! - path: ^fs[\\/]pacer\.go$ diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 976c8878a..f0483d5f2 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -1724,6 +1724,10 @@ func (f *Fs) CleanUp(ctx context.Context) error { token := make(chan struct{}, f.ci.Checkers) var wg sync.WaitGroup 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 { o, ok := obj.(*Object) if !ok {