MCPcopy Create free account
hub / github.com/compose-spec/compose-go / GetAsEqualsMap

Function GetAsEqualsMap

utils/stringutils.go:32–41  ·  view source on GitHub ↗

GetAsEqualsMap split key=value formatted strings into a key : value map

(em []string)

Source from the content-addressed store, hash-verified

30
31// GetAsEqualsMap split key=value formatted strings into a key : value map
32func GetAsEqualsMap(em []string) map[string]string {
33 m := make(map[string]string)
34 for _, v := range em {
35 key, val, found := strings.Cut(v, "=")
36 if found {
37 m[key] = val
38 }
39 }
40 return m
41}
42
43// GetAsEqualsMap format a key : value map into key=value strings
44func GetAsStringList(em map[string]string) []string {

Callers 3

TestEnvMapFunction · 0.92
WithEnvFunction · 0.92
WithOsEnvFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestEnvMapFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…