mirror of
https://github.com/rclone/rclone.git
synced 2024-11-28 03:09:48 +08:00
build: fix gocritic lint issue wrapperfunc
This commit is contained in:
parent
e82b5b11af
commit
33bff6fe71
|
@ -2219,7 +2219,7 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) (
|
|||
case in <- job:
|
||||
default:
|
||||
overflow = append(overflow, job)
|
||||
wg.Add(-1)
|
||||
wg.Done()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ to an encrypted one. Cannot be used in combination with implicit FTPS.`,
|
|||
Default: false,
|
||||
}, {
|
||||
Name: "concurrency",
|
||||
Help: strings.Replace(`Maximum number of FTP simultaneous connections, 0 for unlimited.
|
||||
Help: strings.ReplaceAll(`Maximum number of FTP simultaneous connections, 0 for unlimited.
|
||||
|
||||
Note that setting this is very likely to cause deadlocks so it should
|
||||
be used with care.
|
||||
|
@ -99,7 +99,7 @@ maximum of |--checkers| and |--transfers|.
|
|||
So for |concurrency 3| you'd use |--checkers 2 --transfers 2
|
||||
--check-first| or |--checkers 1 --transfers 1|.
|
||||
|
||||
`, "|", "`", -1),
|
||||
`, "|", "`"),
|
||||
Default: 0,
|
||||
Advanced: true,
|
||||
}, {
|
||||
|
|
|
@ -344,7 +344,7 @@ cost of using more memory.
|
|||
Advanced: true,
|
||||
}, {
|
||||
Name: "connections",
|
||||
Help: strings.Replace(`Maximum number of SFTP simultaneous connections, 0 for unlimited.
|
||||
Help: strings.ReplaceAll(`Maximum number of SFTP simultaneous connections, 0 for unlimited.
|
||||
|
||||
Note that setting this is very likely to cause deadlocks so it should
|
||||
be used with care.
|
||||
|
@ -358,7 +358,7 @@ maximum of |--checkers| and |--transfers|.
|
|||
So for |connections 3| you'd use |--checkers 2 --transfers 2
|
||||
--check-first| or |--checkers 1 --transfers 1|.
|
||||
|
||||
`, "|", "`", -1),
|
||||
`, "|", "`"),
|
||||
Default: 0,
|
||||
Advanced: true,
|
||||
}, {
|
||||
|
|
|
@ -1742,8 +1742,8 @@ func (b *bisyncTest) newReplacer(mangle bool) *strings.Replacer {
|
|||
b.path2, "{path2/}",
|
||||
b.replaceHex(b.path1), "{path1/}",
|
||||
b.replaceHex(b.path2), "{path2/}",
|
||||
"//?/" + strings.TrimSuffix(strings.Replace(b.path1, slash, "/", -1), "/"), "{path1}", // fix windows-specific issue
|
||||
"//?/" + strings.TrimSuffix(strings.Replace(b.path2, slash, "/", -1), "/"), "{path2}",
|
||||
"//?/" + strings.TrimSuffix(strings.ReplaceAll(b.path1, slash, "/"), "/"), "{path1}", // fix windows-specific issue
|
||||
"//?/" + strings.TrimSuffix(strings.ReplaceAll(b.path2, slash, "/"), "/"), "{path2}",
|
||||
strings.TrimSuffix(b.path1, slash), "{path1}", // ensure it's still recognized without trailing slash
|
||||
strings.TrimSuffix(b.path2, slash), "{path2}",
|
||||
b.workDir, "{workdir}",
|
||||
|
|
|
@ -39,8 +39,8 @@ func (b *bisyncRun) indent(tag, file, msg string) {
|
|||
tag = Color(terminal.BlueFg, tag)
|
||||
}
|
||||
msg = Color(terminal.MagentaFg, msg)
|
||||
msg = strings.Replace(msg, "Queue copy to", Color(terminal.GreenFg, "Queue copy to"), -1)
|
||||
msg = strings.Replace(msg, "Queue delete", Color(terminal.RedFg, "Queue delete"), -1)
|
||||
msg = strings.ReplaceAll(msg, "Queue copy to", Color(terminal.GreenFg, "Queue copy to"))
|
||||
msg = strings.ReplaceAll(msg, "Queue delete", Color(terminal.RedFg, "Queue delete"))
|
||||
file = Color(terminal.CyanFg, escapePath(file, false))
|
||||
logf(nil, "- %-18s%-43s - %s", tag, msg, file)
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
)
|
||||
|
||||
// Help contains text describing how to use the proxy
|
||||
var Help = strings.Replace(`### Auth Proxy
|
||||
var Help = strings.ReplaceAll(`### Auth Proxy
|
||||
|
||||
If you supply the parameter |--auth-proxy /path/to/program| then
|
||||
rclone will use that program to generate backends on the fly which
|
||||
|
@ -104,7 +104,7 @@ before it takes effect.
|
|||
This can be used to build general purpose proxies to any kind of
|
||||
backend that rclone supports.
|
||||
|
||||
`, "|", "`", -1)
|
||||
`, "|", "`")
|
||||
|
||||
// Options is options for creating the proxy
|
||||
type Options struct {
|
||||
|
|
|
@ -100,10 +100,7 @@ func convertMountHelperArgs(origArgs []string) ([]string, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
param, value := opt, ""
|
||||
if idx := strings.Index(opt, "="); idx != -1 {
|
||||
param, value = opt[:idx], opt[idx+1:]
|
||||
}
|
||||
param, value, _ := strings.Cut(opt, "=")
|
||||
|
||||
// Set environment variables
|
||||
if strings.HasPrefix(param, "env.") {
|
||||
|
|
|
@ -1807,7 +1807,7 @@ func copyURLFn(ctx context.Context, dstFileName string, url string, autoFilename
|
|||
if autoFilename {
|
||||
if dstFileNameFromHeader {
|
||||
_, params, err := mime.ParseMediaType(resp.Header.Get("Content-Disposition"))
|
||||
headerFilename := path.Base(strings.Replace(params["filename"], "\\", "/", -1))
|
||||
headerFilename := path.Base(strings.ReplaceAll(params["filename"], "\\", "/"))
|
||||
if err != nil || headerFilename == "" {
|
||||
return fmt.Errorf("CopyURL failed: filename not found in the Content-Disposition header")
|
||||
}
|
||||
|
|
|
@ -87,9 +87,10 @@ func argsToEnv(origArgs, origEnv []string) (args, env []string) {
|
|||
}
|
||||
|
||||
arg = arg[2:]
|
||||
key, val := arg, "true"
|
||||
if idx := strings.Index(arg, "="); idx != -1 {
|
||||
key, val = arg[:idx], arg[idx+1:]
|
||||
var key, val string
|
||||
var ok bool
|
||||
if key, val, ok = strings.Cut(arg, "="); !ok {
|
||||
val = "true"
|
||||
}
|
||||
|
||||
name := "RCLONE_" + strings.ToUpper(strings.ReplaceAll(key, "-", "_"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user