make staticcheck happy
This commit is contained in:
parent
ebac0bc8a6
commit
6fe2dcf3c8
|
@ -20,9 +20,9 @@ type TemplateCacheItem struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute writes the template to the supplied writer using the supplied data.
|
// 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)
|
buf := new(bytes.Buffer)
|
||||||
err := self.Template.Execute(buf, d)
|
err := item.Template.Execute(buf, d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ func GetTemplateFromCache(filename string) (*models.TemplateCacheItem, error) {
|
||||||
if template, ok := app.TemplateCache.Cache[filename]; ok {
|
if template, ok := app.TemplateCache.Cache[filename]; ok {
|
||||||
return &template, nil
|
return &template, nil
|
||||||
} else {
|
} else {
|
||||||
return &models.TemplateCacheItem{}, errors.New("Couldn't load template from cache")
|
return &models.TemplateCacheItem{}, errors.New("couldn't load template from cache")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,5 +49,5 @@ func LoadTemplateData(page string) (models.TemplateData, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// couldn't load anything from file
|
// 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")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue