build: fix gocritic lint issue wrapperfunc

This commit is contained in:
albertony
2024-05-31 15:25:27 +02:00
committed by Nick Craig-Wood
parent e82b5b11af
commit 33bff6fe71
9 changed files with 17 additions and 19 deletions

View File

@ -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, "-", "_"))