MCPcopy
hub / github.com/jesseduffield/lazygit / ResolvePlaceholderString

Function ResolvePlaceholderString

pkg/utils/template.go:24–33  ·  view source on GitHub ↗

ResolvePlaceholderString populates a template with values

(str string, arguments map[string]string)

Source from the content-addressed store, hash-verified

22
23// ResolvePlaceholderString populates a template with values
24func ResolvePlaceholderString(str string, arguments map[string]string) string {
25 oldnews := make([]string, 0, len(arguments)*4)
26 for key, value := range arguments {
27 oldnews = append(oldnews,
28 "{{"+key+"}}", value,
29 "{{."+key+"}}", value,
30 )
31 }
32 return strings.NewReplacer(oldnews...).Replace(str)
33}

Callers 15

getLazygitCommandFunction · 0.92
checkForNewUpdateMethod · 0.92
EditRebaseMethod · 0.92
GetGraphCmdObjMethod · 0.92
GetEditCmdStrMethod · 0.92
GetEditAtLineCmdStrMethod · 0.92
OpenFileMethod · 0.92
OpenLinkMethod · 0.92
AppendLineToFileMethod · 0.92

Calls 1

ReplaceMethod · 0.65

Tested by 1