diff --git a/src/template/func_map.go b/src/template/func_map.go new file mode 100644 index 00000000..f6a786d2 --- /dev/null +++ b/src/template/func_map.go @@ -0,0 +1,19 @@ +package template + +import ( + "text/template" + + "github.com/Masterminds/sprig/v3" +) + +func funcMap() template.FuncMap { + funcMap := map[string]interface{}{ + "secondsRound": secondsRound, + } + for key, fun := range sprig.TxtFuncMap() { + if _, ok := funcMap[key]; !ok { + funcMap[key] = fun + } + } + return template.FuncMap(funcMap) +} diff --git a/src/template/template_func.go b/src/template/round.go similarity index 78% rename from src/template/template_func.go rename to src/template/round.go index 56084e80..09d5c74c 100644 --- a/src/template/template_func.go +++ b/src/template/round.go @@ -4,23 +4,8 @@ import ( "errors" "strconv" "strings" - "text/template" - - "github.com/Masterminds/sprig/v3" ) -func funcMap() template.FuncMap { - funcMap := map[string]interface{}{ - "secondsRound": secondsRound, - } - for key, fun := range sprig.TxtFuncMap() { - if _, ok := funcMap[key]; !ok { - funcMap[key] = fun - } - } - return template.FuncMap(funcMap) -} - func parseSeconds(seconds interface{}) (int, error) { switch seconds := seconds.(type) { default: diff --git a/src/template/template.go b/src/template/text.go similarity index 100% rename from src/template/template.go rename to src/template/text.go diff --git a/src/template/template_test.go b/src/template/text_test.go similarity index 100% rename from src/template/template_test.go rename to src/template/text_test.go