diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-21 10:26:14 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-21 10:26:14 +0100 |
commit | 50cc7fe54580018239ea95aafe67f6a158cdcc9f (patch) | |
tree | 18fd25561fb04fd14e3db6c306c2ef6c3de790d0 /tpl | |
parent | 1773d71d5b40f5a6a14edca417d2818607a499f1 (diff) |
tpl: Do not return any value in errorf
Fixes #6653
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/fmt/fmt.go | 6 | ||||
-rw-r--r-- | tpl/fmt/init.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tpl/fmt/fmt.go b/tpl/fmt/fmt.go index 7e0258650..aa6b8c1a6 100644 --- a/tpl/fmt/fmt.go +++ b/tpl/fmt/fmt.go @@ -51,11 +51,11 @@ func (ns *Namespace) Println(a ...interface{}) string { return _fmt.Sprintln(a...) } -// Errorf formats according to a format specifier and returns the string as a -// value that satisfies error. +// Errorf formats according to a format specifier and logs an ERROR. +// It returns an empty string. func (ns *Namespace) Errorf(format string, a ...interface{}) string { ns.errorLogger.Printf(format, a...) - return _fmt.Sprintf(format, a...) + return "" } // Warnf formats according to a format specifier and logs a WARNING. diff --git a/tpl/fmt/init.go b/tpl/fmt/init.go index 14568b45a..6a2c9a856 100644 --- a/tpl/fmt/init.go +++ b/tpl/fmt/init.go @@ -53,7 +53,7 @@ func init() { ns.AddMethodMapping(ctx.Errorf, []string{"errorf"}, [][2]string{ - {`{{ errorf "%s." "failed" }}`, `failed.`}, + {`{{ errorf "%s." "failed" }}`, ``}, }, ) |