From 6fe2dcf3c8cd0d57337eb54830502c2c880429eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Fri, 9 Feb 2024 00:25:40 -0800 Subject: [PATCH] make staticcheck happy --- internal/models/templatecache.go | 4 ++-- internal/render/render.go | 2 +- internal/td/td.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/models/templatecache.go b/internal/models/templatecache.go index 4da6c13..bd4690a 100644 --- a/internal/models/templatecache.go +++ b/internal/models/templatecache.go @@ -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 } diff --git a/internal/render/render.go b/internal/render/render.go index 5513cc7..ee01306 100644 --- a/internal/render/render.go +++ b/internal/render/render.go @@ -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") } } diff --git a/internal/td/td.go b/internal/td/td.go index c7e47d5..9f9fec1 100644 --- a/internal/td/td.go +++ b/internal/td/td.go @@ -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") }