github.com/moby/docker@v26.1.3+incompatible/libcontainerd/local/utils_windows.go (about)

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