dircache: simplify interface, fix corner cases and apply to backends
Dircache was changed to: - Remove special cases for the root directory - Remove Fatal errors - Call FindRoot on behalf of the user wherever possible - Bring up to modern Go standards Backends were changed to: - Remove calls to FindRoot - Change calls to FindRootAndPath to FindPath - Don't make special cases for the root This fixes several corner cases, for example removing a non existent directory if FindRoot hasn't been called.
This commit is contained in:
parent
81151523af
commit
a8652e2252
14 changed files with 234 additions and 633 deletions
|
@ -148,11 +148,6 @@ func (f *Fs) listFolders(ctx context.Context, directoryID int) (foldersList *Fol
|
|||
}
|
||||
|
||||
func (f *Fs) listDir(ctx context.Context, dir string) (entries fs.DirEntries, err error) {
|
||||
err = f.dirCache.FindRoot(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
directoryID, err := f.dirCache.FindDir(ctx, dir, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue