fstest: Use walk.ListR for listing

This commit is contained in:
Nick Craig-Wood 2019-01-21 17:02:48 +00:00
parent 47099466c0
commit 7267d19ad8
2 changed files with 3 additions and 12 deletions

View File

@ -468,11 +468,8 @@ func Purge(f fs.Fs) {
}
if doFallbackPurge {
dirs := []string{""}
err = walk.Walk(f, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
if err != nil {
log.Printf("purge walk returned error: %v", err)
return nil
}
err = walk.ListR(f, "", true, -1, walk.ListAll, func(entries fs.DirEntries) error {
var err error
entries.ForObject(func(obj fs.Object) {
fs.Debugf(f, "Purge object %q", obj.Remote())
err = obj.Remove()

View File

@ -139,13 +139,7 @@ func newRunIndividual(t *testing.T, individual bool) *Run {
*r = *oneRun
r.cleanRemote = func() {
var toDelete []string
err := walk.Walk(r.Fremote, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
if err != nil {
if err == fs.ErrorDirNotFound {
return nil
}
t.Fatalf("Error listing: %v", err)
}
err := walk.ListR(r.Fremote, "", true, -1, walk.ListAll, func(entries fs.DirEntries) error {
for _, entry := range entries {
switch x := entry.(type) {
case fs.Object: