aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_tree.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-02-25 22:23:59 -0800
committerChris Lu <chris.lu@gmail.com>2020-02-25 22:23:59 -0800
commit97ab8a1976f3ba056af8d5b630dcb43006425b51 (patch)
treef98588240db017bf7d372b0f216355892cf868e8 /weed/shell/command_fs_tree.go
parentca4ca1ae6f87c6fcbf9c486722f36b4f07166187 (diff)
downloadseaweedfs-97ab8a1976f3ba056af8d5b630dcb43006425b51.tar.xz
seaweedfs-97ab8a1976f3ba056af8d5b630dcb43006425b51.zip
remove ctx if possible
Diffstat (limited to 'weed/shell/command_fs_tree.go')
-rw-r--r--weed/shell/command_fs_tree.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/weed/shell/command_fs_tree.go b/weed/shell/command_fs_tree.go
index fb2583240..04530571c 100644
--- a/weed/shell/command_fs_tree.go
+++ b/weed/shell/command_fs_tree.go
@@ -1,7 +1,6 @@
package shell
import (
- "context"
"fmt"
"io"
"strings"
@@ -37,9 +36,7 @@ func (c *commandFsTree) Do(args []string, commandEnv *CommandEnv, writer io.Writ
dir, name := filer2.FullPath(path).DirAndName()
- ctx := context.Background()
-
- dirCount, fCount, terr := treeTraverseDirectory(ctx, writer, commandEnv.getFilerClient(filerServer, filerPort), filer2.FullPath(dir), name, newPrefix(), -1)
+ dirCount, fCount, terr := treeTraverseDirectory(writer, commandEnv.getFilerClient(filerServer, filerPort), filer2.FullPath(dir), name, newPrefix(), -1)
if terr == nil {
fmt.Fprintf(writer, "%d directories, %d files\n", dirCount, fCount)
@@ -49,7 +46,7 @@ func (c *commandFsTree) Do(args []string, commandEnv *CommandEnv, writer io.Writ
}
-func treeTraverseDirectory(ctx context.Context, writer io.Writer, filerClient filer2.FilerClient, dir filer2.FullPath, name string, prefix *Prefix, level int) (directoryCount, fileCount int64, err error) {
+func treeTraverseDirectory(writer io.Writer, filerClient filer2.FilerClient, dir filer2.FullPath, name string, prefix *Prefix, level int) (directoryCount, fileCount int64, err error) {
prefix.addMarker(level)
@@ -65,7 +62,7 @@ func treeTraverseDirectory(ctx context.Context, writer io.Writer, filerClient fi
if entry.IsDirectory {
directoryCount++
subDir := dir.Child(entry.Name)
- dirCount, fCount, terr := treeTraverseDirectory(ctx, writer, filerClient, subDir, "", prefix, level+1)
+ dirCount, fCount, terr := treeTraverseDirectory(writer, filerClient, subDir, "", prefix, level+1)
directoryCount += dirCount
fileCount += fCount
err = terr