MCPcopy Index your code
hub / github.com/docker/cli / convertEnvironment

Function convertEnvironment

cli/compose/convert/service.go:616–629  ·  view source on GitHub ↗

convertEnvironment converts key/value mappings to a slice, and sorts the results.

(source map[string]*string)

Source from the content-addressed store, hash-verified

614// convertEnvironment converts key/value mappings to a slice, and sorts
615// the results.
616func convertEnvironment(source map[string]*string) []string {
617 var output []string
618
619 for name, value := range source {
620 switch value {
621 case nil:
622 output = append(output, name)
623 default:
624 output = append(output, name+"="+*value)
625 }
626 }
627 sort.Strings(output)
628 return output
629}
630
631func convertDeployMode(mode string, replicas *uint64) (swarm.ServiceMode, error) {
632 serviceMode := swarm.ServiceMode{}

Callers 3

TestConvertEnvironmentFunction · 0.85
ServiceFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestConvertEnvironmentFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…