summaryrefslogtreecommitdiffstats
path: root/modules/templates
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates')
-rw-r--r--modules/templates/dynamic.go10
-rw-r--r--modules/templates/helper.go2
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/templates/dynamic.go b/modules/templates/dynamic.go
index dbd75221d2..d7c04ccb09 100644
--- a/modules/templates/dynamic.go
+++ b/modules/templates/dynamic.go
@@ -83,12 +83,15 @@ func Mailer() *template.Template {
continue
}
- templates.New(
+ _, err = templates.New(
strings.TrimSuffix(
filePath,
".tmpl",
),
).Parse(string(content))
+ if err != nil {
+ log.Warn("Failed to parse template %v", err)
+ }
}
}
}
@@ -113,12 +116,15 @@ func Mailer() *template.Template {
continue
}
- templates.New(
+ _, err = templates.New(
strings.TrimSuffix(
filePath,
".tmpl",
),
).Parse(string(content))
+ if err != nil {
+ log.Warn("Failed to parse template %v", err)
+ }
}
}
}
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index ef4a68add0..c4551bb4be 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -343,7 +343,7 @@ func ReplaceLeft(s, oldS, newS string) string {
// allocating space for the new string
curLen := n*newLen + len(s[i:])
- replacement := make([]byte, curLen, curLen)
+ replacement := make([]byte, curLen)
j := 0
for ; j < n*newLen; j += newLen {