libcontainerd/local: use strings.Cut()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6059d38f21
commit
01365cbd74
1 changed files with 2 additions and 3 deletions
|
@ -7,9 +7,8 @@ import "strings"
|
|||
func setupEnvironmentVariables(a []string) map[string]string {
|
||||
r := make(map[string]string)
|
||||
for _, s := range a {
|
||||
arr := strings.SplitN(s, "=", 2)
|
||||
if len(arr) == 2 {
|
||||
r[arr[0]] = arr[1]
|
||||
if k, v, ok := strings.Cut(s, "="); ok {
|
||||
r[k] = v
|
||||
}
|
||||
}
|
||||
return r
|
||||
|
|
Loading…
Reference in a new issue