GetTemplateByBytes returns the parsed template as a byte slice. It returns an error if the template processing fails.
(name string, data map[string]any)
| 61 | // GetTemplateByBytes returns the parsed template as a byte slice. |
| 62 | // It returns an error if the template processing fails. |
| 63 | func 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. |
no test coverage detected