fstest: Use walk.ListR for listing
This commit is contained in:
parent
47099466c0
commit
7267d19ad8
2 changed files with 3 additions and 12 deletions
|
@ -468,11 +468,8 @@ func Purge(f fs.Fs) {
|
||||||
}
|
}
|
||||||
if doFallbackPurge {
|
if doFallbackPurge {
|
||||||
dirs := []string{""}
|
dirs := []string{""}
|
||||||
err = walk.Walk(f, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
|
err = walk.ListR(f, "", true, -1, walk.ListAll, func(entries fs.DirEntries) error {
|
||||||
if err != nil {
|
var err error
|
||||||
log.Printf("purge walk returned error: %v", err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
entries.ForObject(func(obj fs.Object) {
|
entries.ForObject(func(obj fs.Object) {
|
||||||
fs.Debugf(f, "Purge object %q", obj.Remote())
|
fs.Debugf(f, "Purge object %q", obj.Remote())
|
||||||
err = obj.Remove()
|
err = obj.Remove()
|
||||||
|
|
|
@ -139,13 +139,7 @@ func newRunIndividual(t *testing.T, individual bool) *Run {
|
||||||
*r = *oneRun
|
*r = *oneRun
|
||||||
r.cleanRemote = func() {
|
r.cleanRemote = func() {
|
||||||
var toDelete []string
|
var toDelete []string
|
||||||
err := walk.Walk(r.Fremote, "", true, -1, func(dirPath string, entries fs.DirEntries, err error) error {
|
err := walk.ListR(r.Fremote, "", true, -1, walk.ListAll, func(entries fs.DirEntries) error {
|
||||||
if err != nil {
|
|
||||||
if err == fs.ErrorDirNotFound {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
t.Fatalf("Error listing: %v", err)
|
|
||||||
}
|
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
switch x := entry.(type) {
|
switch x := entry.(type) {
|
||||||
case fs.Object:
|
case fs.Object:
|
||||||
|
|
Loading…
Reference in a new issue