fs: Document that Purger returns error on empty directory, test and fix
This commit is contained in:
parent
9711a5d647
commit
2f9f9afac2
4 changed files with 19 additions and 4 deletions
|
@ -161,9 +161,12 @@ func RandomRemote(remoteName string, subdir bool) (fs.Fs, func()) {
|
|||
}
|
||||
|
||||
finalise := func() {
|
||||
TestPurge(remote)
|
||||
_ = fs.Purge(remote) // ignore error
|
||||
if parentRemote != nil {
|
||||
TestPurge(parentRemote)
|
||||
err = fs.Purge(parentRemote) // ignore error
|
||||
if err != nil {
|
||||
log.Printf("Failed to purge %v: %v", parentRemote, err)
|
||||
}
|
||||
}
|
||||
// Delete directory if we made one above
|
||||
if rmdir != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue