MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / ExecuteString

Method ExecuteString

pkg/util/fasttemplate/template.go:191–193  ·  view source on GitHub ↗

ExecuteString substitutes template tags (placeholders) with the corresponding values from the map m and returns the result. Substitution map m may contain values with the following types: - []byte - the fastest value type - string - convenient value type - TagFunc - flexible value type This functi

(m map[string]interface{})

Source from the content-addressed store, hash-verified

189// This function is optimized for frozen templates.
190// Use ExecuteString for constantly changing templates.
191func (t *Template) ExecuteString(m map[string]interface{}) []byte {
192 return t.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) })
193}
194
195func stdTagFunc(w io.Writer, tag string, m map[string]interface{}) (int, error) {
196 v := m[tag]

Callers 1

FormatMethod · 0.80

Calls 2

ExecuteFuncStringMethod · 0.95
stdTagFuncFunction · 0.85

Tested by

no test coverage detected