MCPcopy Create free account
hub / github.com/appleboy/CodeGPT / GetTemplateByBytes

Function GetTemplateByBytes

util/template.go:63–66  ·  view source on GitHub ↗

GetTemplateByBytes returns the parsed template as a byte slice. It returns an error if the template processing fails.

(name string, data map[string]any)

Source from the content-addressed store, hash-verified

61// GetTemplateByBytes returns the parsed template as a byte slice.
62// It returns an error if the template processing fails.
63func GetTemplateByBytes(name string, data map[string]any) ([]byte, error) {
64 tpl, err := processTemplate(name, data)
65 return tpl.Bytes(), err
66}
67
68// LoadTemplates loads all the templates found in the templates directory from the embedded filesystem.
69// It returns an error if reading the directory or parsing any template fails.

Callers 1

InstallHookMethod · 0.92

Calls 1

processTemplateFunction · 0.85

Tested by

no test coverage detected