mirror of
https://github.com/minio/mc.git
synced 2025-11-10 13:42:32 +03:00
Add admin lock command (#1942)
This commit is contained in:
committed by
Harshavardhana
parent
86777e7863
commit
7cec8f2285
12
cmd/utils.go
12
cmd/utils.go
@@ -21,6 +21,7 @@ import (
|
||||
"io"
|
||||
"math/rand"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/minio/mc/pkg/console"
|
||||
@@ -75,3 +76,14 @@ func dumpTLSCertificates(t *tls.ConnectionState) {
|
||||
func isStdIO(reader io.Reader) bool {
|
||||
return reader == os.Stdin || reader == os.Stdout || reader == os.Stderr
|
||||
}
|
||||
|
||||
// splitStr splits a string into n parts, empty strings are added
|
||||
// if we are not able to reach n elements
|
||||
func splitStr(path, sep string, n int) []string {
|
||||
splits := strings.SplitN(path, sep, n)
|
||||
// Add empty strings if we found elements less than nr
|
||||
for i := n - len(splits); i > 0; i-- {
|
||||
splits = append(splits, "")
|
||||
}
|
||||
return splits
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user