MCPcopy
hub / github.com/sqlc-dev/sqlc / Replace

Method Replace

internal/shfmt/shfmt.go:15–21  ·  view source on GitHub ↗
(f string)

Source from the content-addressed store, hash-verified

13}
14
15func (r *Replacer) Replace(f string) string {
16 return pat.ReplaceAllStringFunc(f, func(s string) string {
17 s = strings.TrimPrefix(s, "${")
18 s = strings.TrimSuffix(s, "}")
19 return r.envmap[s]
20 })
21}
22
23func NewReplacer(env []string) *Replacer {
24 r := Replacer{

Callers 15

TestReplaceFunction · 0.95
cleanFunction · 0.45
runFunction · 0.45
CreateDatabaseMethod · 0.45
TestApplyFunction · 0.45
AnalyzeMethod · 0.45
EnsureConnMethod · 0.45
AnalyzeMethod · 0.45
EnsureConnMethod · 0.45
lineEndingsFunction · 0.45
stderrTransformerFunction · 0.45
TestINMethod · 0.45

Calls

no outgoing calls

Tested by 4

TestReplaceFunction · 0.76
TestApplyFunction · 0.36
lineEndingsFunction · 0.36
stderrTransformerFunction · 0.36