MCPcopy Create free account
hub / github.com/foxcpp/maddy / buildEnvReplacer

Function buildEnvReplacer

framework/cfgparser/env.go:56–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56func buildEnvReplacer() *strings.Replacer {
57 env := os.Environ()
58 pairs := make([]string, 0, len(env)*4)
59 for _, entry := range env {
60 parts := strings.SplitN(entry, "=", 2)
61 key := parts[0]
62 value := parts[1]
63
64 pairs = append(pairs, "{env:"+key+"}", value)
65 }
66 return strings.NewReplacer(pairs...)
67}

Callers 1

expandEnvironmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected