From 0309bfb0ec876d36abaeed379f890a8d8260f8e2 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 17 Oct 2024 17:31:03 +0200 Subject: [PATCH] feat(templates): add sprig to multimodal templates Signed-off-by: Ettore Di Giacinto --- pkg/templates/multimodal.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/templates/multimodal.go b/pkg/templates/multimodal.go index cc56c4920534..a2056640febf 100644 --- a/pkg/templates/multimodal.go +++ b/pkg/templates/multimodal.go @@ -3,11 +3,13 @@ package templates import ( "bytes" "text/template" + + "github.com/Masterminds/sprig/v3" ) func TemplateMultiModal(templateString string, templateID int, text string) (string, error) { // compile the template - tmpl, err := template.New("template").Parse(templateString) + tmpl, err := template.New("template").Funcs(sprig.FuncMap()).Parse(templateString) if err != nil { return "", err }