moby/libcontainerd/local/utils_windows.go
Sebastiaan van Stijn 01365cbd74
libcontainerd/local: use strings.Cut()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 11:09:02 +01:00

15 lines
443 B
Go

package local // import "github.com/docker/docker/libcontainerd/local"
import "strings"
// setupEnvironmentVariables converts a string array of environment variables
// into a map as required by the HCS. Source array is in format [v1=k1] [v2=k2] etc.
func setupEnvironmentVariables(a []string) map[string]string {
r := make(map[string]string)
for _, s := range a {
if k, v, ok := strings.Cut(s, "="); ok {
r[k] = v
}
}
return r
}