mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 11:58:20 +08:00
fstest: Use walk.ListR for listing
This commit is contained in:
parent
47099466c0
commit
7267d19ad8
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user