MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / SliceToMap

Function SliceToMap

pkg/util/envutil/envutil.go:95–104  ·  view source on GitHub ↗
(env []string)

Source from the content-addressed store, hash-verified

93}
94
95func SliceToMap(env []string) map[string]string {
96 envMap := make(map[string]string)
97 for _, envVar := range env {
98 parts := strings.SplitN(envVar, "=", 2)
99 if len(parts) == 2 {
100 envMap[parts[0]] = parts[1]
101 }
102 }
103 return envMap
104}
105
106func CopyAndAddToEnvMap(envMap map[string]string, key string, val string) map[string]string {
107 newMap := make(map[string]string, len(envMap)+1)

Callers 2

serverRunFunction · 0.92
createMainWshClientFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected