MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / EnvToSlice

Function EnvToSlice

pkg/util/envutil/envutil.go:83–93  ·  view source on GitHub ↗
(envStr string)

Source from the content-addressed store, hash-verified

81}
82
83func EnvToSlice(envStr string) []string {
84 envLines := strings.Split(envStr, "\x00")
85 result := make([]string, 0, len(envLines))
86 for _, line := range envLines {
87 if len(line) == 0 {
88 continue
89 }
90 result = append(result, line)
91 }
92 return result
93}
94
95func SliceToMap(env []string) map[string]string {
96 envMap := make(map[string]string)

Callers 1

FixupWaveZshHistoryFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected