MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / replaceEnvVars

Function replaceEnvVars

agent/utils/docker/compose.go:138–146  ·  view source on GitHub ↗
(input string, envVars map[string]string)

Source from the content-addressed store, hash-verified

136}
137
138func replaceEnvVars(input string, envVars map[string]string) string {
139 return re.GetRegex(re.ComposeEnvVarPattern).ReplaceAllStringFunc(input, func(match string) string {
140 varName := match[2 : len(match)-1]
141 if value, exists := envVars[varName]; exists {
142 return value
143 }
144 return match
145 })
146}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected