MCPcopy Create free account
hub / github.com/HoneyLLM/cli2ssh / formatTemplate

Function formatTemplate

internal/args/args.go:64–76  ·  view source on GitHub ↗
(templateStr string, data any)

Source from the content-addressed store, hash-verified

62}
63
64func formatTemplate(templateStr string, data any) string {
65 template, err := template.New("").Parse(templateStr)
66 if err != nil {
67 return templateStr
68 }
69
70 var buf bytes.Buffer
71 err = template.Execute(&buf, data)
72 if err != nil {
73 return templateStr
74 }
75 return buf.String()
76}

Callers 2

FormatArgMethod · 0.85
FormatArgsMethod · 0.85

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected