aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/template.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-03-24 10:11:16 +0100
committerBjørn Erik Pedersen <[email protected]>2019-03-24 16:14:51 +0100
commitb5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7 (patch)
treecf23180dc07698391cf47c2fe525755417729020 /tpl/template.go
parent3011f36c27ecde309325e6c75ca377f4f87fa97a (diff)
downloadhugo-b5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7.tar.gz
hugo-b5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7.zip
all: Apply staticcheck recommendations
Diffstat (limited to 'tpl/template.go')
-rw-r--r--tpl/template.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tpl/template.go b/tpl/template.go
index 07152166a..01f79c407 100644
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -152,7 +152,7 @@ func (t *TemplateAdapter) Execute(w io.Writer, data interface{}) (execErr error)
// Panics in templates are a little bit too common (nil pointers etc.)
// See https://github.com/gohugoio/hugo/issues/5327
if r := recover(); r != nil {
- execErr = t.addFileContext(t.Name(), fmt.Errorf(`panic in Execute: %s. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.`, r))
+ execErr = t.addFileContext(t.Name(), fmt.Errorf(`panic in Execute: %s. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this`, r))
}
}()
@@ -174,7 +174,7 @@ func (t *TemplateAdapter) TemplateInfo() Info {
// The identifiers may be truncated in the log, e.g.
// "executing "main" at <$scaled.SRelPermalin...>: can't evaluate field SRelPermalink in type *resource.Image"
-var identifiersRe = regexp.MustCompile("at \\<(.*?)(\\.{3})?\\>:")
+var identifiersRe = regexp.MustCompile(`at \<(.*?)(\.{3})?\>:`)
func (t *TemplateAdapter) extractIdentifiers(line string) []string {
m := identifiersRe.FindAllStringSubmatch(line, -1)