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 {
|
func setupEnvironmentVariables(a []string) map[string]string {
|
||||||
r := make(map[string]string)
|
r := make(map[string]string)
|
||||||
for _, s := range a {
|
for _, s := range a {
|
||||||
arr := strings.SplitN(s, "=", 2)
|
if k, v, ok := strings.Cut(s, "="); ok {
|
||||||
if len(arr) == 2 {
|
r[k] = v
|
||||||
r[arr[0]] = arr[1]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Reference in a new issue