MCPcopy Create free account
hub / github.com/celer-pkg/celer / Expand

Method Expand

context/expr_vars.go:48–60  ·  view source on GitHub ↗

Expand replace express with values.

(content string)

Source from the content-addressed store, hash-verified

46
47// Expand replace express with values.
48func (e ExprVars) Expand(content string) string {
49 if e.vars == nil {
50 e.vars = make(map[string]string)
51 }
52
53 for key, value := range e.vars {
54 content = strings.ReplaceAll(content, fmt.Sprintf("${%s}", key), value)
55 content = strings.ReplaceAll(content, fmt.Sprintf("$%s", key), value)
56 content = e.replaceEnvVars(content)
57 }
58
59 return content
60}
61
62// replaceEnvVars replace env express with env value.
63func (e ExprVars) replaceEnvVars(content string) string {

Callers 8

appendVarsMethod · 0.80
appendEnvsMethod · 0.80
appendMacrosMethod · 0.80
SetupEnvsMethod · 0.80
generateMethod · 0.80
loadProjectVarsMethod · 0.80
expandOptionsMethod · 0.80
expandVariablesMethod · 0.80

Calls 2

replaceEnvVarsMethod · 0.95
SprintfMethod · 0.80

Tested by

no test coverage detected