MCPcopy
hub / github.com/spf13/cobra / AddTemplateFunc

Function AddTemplateFunc

cobra.go:85–87  ·  view source on GitHub ↗

AddTemplateFunc adds a template function that's available to Usage and Help template generation.

(name string, tmplFunc interface{})

Source from the content-addressed store, hash-verified

83// AddTemplateFunc adds a template function that's available to Usage and Help
84// template generation.
85func AddTemplateFunc(name string, tmplFunc interface{}) {
86 templateFuncs[name] = tmplFunc
87}
88
89// AddTemplateFuncs adds multiple template functions that are available to Usage and
90// Help template generation.

Callers 1

TestAddTemplateFunctionsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestAddTemplateFunctionsFunction · 0.68