libcontainerd/local: use strings.Cut()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-11-01 12:45:23 +01:00
parent 6059d38f21
commit 01365cbd74
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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