aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/shell_liner.go
diff options
context:
space:
mode:
authorguosj <515878133@qq.com>2022-04-19 09:26:06 +0800
committerguosj <515878133@qq.com>2022-04-19 09:26:06 +0800
commit94c702402e879843792acc4be2cf01198268f250 (patch)
tree593eb933dffc877010c761b2c55ec6c73875e9a3 /weed/shell/shell_liner.go
parent5c9a3bb8cf68ed99acb53dd548c92b54744d7fd7 (diff)
parent82ee31965dd7a1ad2d348c7e9dadb254744bf9b0 (diff)
downloadseaweedfs-94c702402e879843792acc4be2cf01198268f250.tar.xz
seaweedfs-94c702402e879843792acc4be2cf01198268f250.zip
Merge branch 'chrislusf-master'
Diffstat (limited to 'weed/shell/shell_liner.go')
-rw-r--r--weed/shell/shell_liner.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go
index 90ce2dbb4..94a68f5bc 100644
--- a/weed/shell/shell_liner.go
+++ b/weed/shell/shell_liner.go
@@ -8,12 +8,12 @@ import (
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/util/grace"
+ "golang.org/x/exp/slices"
"io"
"math/rand"
"os"
"path"
"regexp"
- "sort"
"strings"
"github.com/peterh/liner"
@@ -25,11 +25,9 @@ var (
)
func RunShell(options ShellOptions) {
-
- sort.Slice(Commands, func(i, j int) bool {
- return strings.Compare(Commands[i].Name(), Commands[j].Name()) < 0
+ slices.SortFunc(Commands, func(a, b command) bool {
+ return strings.Compare(a.Name(), b.Name()) < 0
})
-
line = liner.NewLiner()
defer line.Close()
grace.OnInterrupt(func() {