utils_windows.go 466 B

12345678910111213141516
  1. package local // import "github.com/docker/docker/libcontainerd/local"
  2. import "strings"
  3. // setupEnvironmentVariables converts a string array of environment variables
  4. // into a map as required by the HCS. Source array is in format [v1=k1] [v2=k2] etc.
  5. func setupEnvironmentVariables(a []string) map[string]string {
  6. r := make(map[string]string)
  7. for _, s := range a {
  8. arr := strings.SplitN(s, "=", 2)
  9. if len(arr) == 2 {
  10. r[arr[0]] = arr[1]
  11. }
  12. }
  13. return r
  14. }