MCPcopy Index your code
hub / github.com/jetify-com/devbox / PairsToMap

Function PairsToMap

internal/envir/util.go:65–75  ·  view source on GitHub ↗

PairsToMap creates a map from a slice of "key=value" environment variable pairs. Note that maps are not ordered, which can affect the final variable values when pairs contains duplicate keys.

(pairs []string)

Source from the content-addressed store, hash-verified

63// pairs. Note that maps are not ordered, which can affect the final variable
64// values when pairs contains duplicate keys.
65func PairsToMap(pairs []string) map[string]string {
66 vars := make(map[string]string, len(pairs))
67 for _, p := range pairs {
68 k, v, ok := strings.Cut(p, "=")
69 if !ok {
70 continue
71 }
72 vars[k] = v
73 }
74 return vars
75}

Callers 3

RunScriptMethod · 0.92
testWriteDevboxShellrcFunction · 0.92
IsEnvEnabledMethod · 0.92

Calls

no outgoing calls

Tested by 1

testWriteDevboxShellrcFunction · 0.74