MCPcopy
hub / github.com/regclient/regclient / String

Function String

pkg/template/template.go:77–84  ·  view source on GitHub ↗

String converts a template to a string

(tmpl string, data any, opts ...Opt)

Source from the content-addressed store, hash-verified

75
76// String converts a template to a string
77func String(tmpl string, data any, opts ...Opt) (string, error) {
78 var sb strings.Builder
79 err := Writer(&sb, tmpl, data)
80 if err != nil {
81 return "", err
82 }
83 return sb.String(), nil
84}
85
86// WithFuncs includes additional template functions
87func WithFuncs(funcs gotemplate.FuncMap) Opt {

Callers 3

processRefMethod · 0.92
configExpandTemplatesFunction · 0.92
configExpandTemplatesFunction · 0.92

Calls 2

WriterFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…