From 279adc3a6e6d28119013b01c3e4a87d73472d885 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 7 Feb 2018 14:58:37 +0100 Subject: [PATCH] Add replacement function Signed-off-by: Knut Ahlers --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 148ebb9..2c71674 100644 --- a/main.go +++ b/main.go @@ -189,9 +189,14 @@ func getOutfile(repo *github.Repository) (string, error) { return buf.String(), err } +func simpleReplace(s, old, new string) string { + return strings.Replace(s, old, new, -1) +} + func tplFuncs() template.FuncMap { return template.FuncMap{ "chkPtrBool": func(i *bool) bool { return i != nil && *i }, "slugify": slug.Make, + "replace": simpleReplace, } }