From cef2e3bf83d02f4a088b4546c71772979d98f3fd Mon Sep 17 00:00:00 2001 From: Iakov Davydov Date: Thu, 9 Nov 2017 10:27:31 +0100 Subject: [PATCH] path -> startPath in walkRDirTree (we need the path package) --- fs/walk.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/walk.go b/fs/walk.go index 336597385..8a2fab4f5 100644 --- a/fs/walk.go +++ b/fs/walk.go @@ -347,10 +347,10 @@ func (dt DirTree) String() string { return out.String() } -func walkRDirTree(f Fs, path string, includeAll bool, maxLevel int, listR ListRFn) (DirTree, error) { +func walkRDirTree(f Fs, startPath string, includeAll bool, maxLevel int, listR ListRFn) (DirTree, error) { dirs := make(DirTree) var mu sync.Mutex - err := listR(path, func(entries DirEntries) error { + err := listR(startPath, func(entries DirEntries) error { mu.Lock() defer mu.Unlock() for _, entry := range entries { @@ -367,7 +367,7 @@ func walkRDirTree(f Fs, path string, includeAll bool, maxLevel int, listR ListRF for ; slashes > maxLevel-1; slashes-- { dirPath = parentDir(dirPath) } - dirs.checkParent(path, dirPath) + dirs.checkParent(startPath, dirPath) } } else { Debugf(x, "Excluded from sync (and deletion)") @@ -394,9 +394,9 @@ func walkRDirTree(f Fs, path string, includeAll bool, maxLevel int, listR ListRF if err != nil { return nil, err } - dirs.checkParents(path) + dirs.checkParents(startPath) if len(dirs) == 0 { - dirs[path] = nil + dirs[startPath] = nil } dirs.Sort() return dirs, nil