From e1db6dce8219c6994a637c1bb9c1d1bb19ca1576 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 17 Oct 2024 17:34:20 +0200 Subject: [PATCH] feat(templates): add sprig to multimodal templates (#3868) 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 cc56c492..a2056640 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 }