Use consts for route names and templates.
This commit is contained in:
parent
a787d5dc7f
commit
60c8aefd49
30 changed files with 135 additions and 82 deletions
|
|
@ -155,7 +155,7 @@ func (t *TemplateRenderer) Load(group, key string) (*TemplateParsed, error) {
|
|||
}
|
||||
|
||||
// Execute executes a template with the given data and provides the output
|
||||
func (t *TemplateParsed) Execute(data interface{}) (*bytes.Buffer, error) {
|
||||
func (t *TemplateParsed) Execute(data any) (*bytes.Buffer, error) {
|
||||
if t.Template == nil {
|
||||
return nil, errors.New("cannot execute template: template not initialized")
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ func (t *templateBuilder) Store() (*TemplateParsed, error) {
|
|||
|
||||
// Execute executes the template with the given data.
|
||||
// If the template has not already been cached, this will parse and cache the template
|
||||
func (t *templateBuilder) Execute(data interface{}) (*bytes.Buffer, error) {
|
||||
func (t *templateBuilder) Execute(data any) (*bytes.Buffer, error) {
|
||||
tp, err := t.Store()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue