make staticcheck happy

This commit is contained in:
Lilian Jónsdóttir 2024-02-09 00:25:40 -08:00
parent ebac0bc8a6
commit 6fe2dcf3c8
3 changed files with 4 additions and 4 deletions

View file

@ -20,9 +20,9 @@ type TemplateCacheItem struct {
}
// Execute writes the template to the supplied writer using the supplied data.
func (self *TemplateCacheItem) Execute(d *TemplateData, w http.ResponseWriter) error {
func (item *TemplateCacheItem) Execute(d *TemplateData, w http.ResponseWriter) error {
buf := new(bytes.Buffer)
err := self.Template.Execute(buf, d)
err := item.Template.Execute(buf, d)
if err != nil {
return err
}

View file

@ -85,7 +85,7 @@ func GetTemplateFromCache(filename string) (*models.TemplateCacheItem, error) {
if template, ok := app.TemplateCache.Cache[filename]; ok {
return &template, nil
} else {
return &models.TemplateCacheItem{}, errors.New("Couldn't load template from cache")
return &models.TemplateCacheItem{}, errors.New("couldn't load template from cache")
}
}

View file

@ -49,5 +49,5 @@ func LoadTemplateData(page string) (models.TemplateData, error) {
}
// couldn't load anything from file
return models.TemplateData{}, errors.New("Couldn't load data from file")
return models.TemplateData{}, errors.New("couldn't load data from file")
}