From 3288fc02dd2319848217778cde2a4523dc60a201 Mon Sep 17 00:00:00 2001 From: umomany Date: Tue, 1 Jun 2021 16:04:11 +0300 Subject: [PATCH] add extra template function "Contains" LIT-406071 --- helper.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helper.go b/helper.go index bcf02f0..da727b8 100644 --- a/helper.go +++ b/helper.go @@ -16,8 +16,9 @@ func sendMessageToChat(alerts []alerttemplate.Alert, notif *Notifier, webHookURL ) // common funcs used in template templateFuncMap := template.FuncMap{ - "Title": strings.Title, - "toUpper": strings.ToUpper, + "Title": strings.Title, + "toUpper": strings.ToUpper, + "Contains": strings.Contains, } // read template file tmpl, err := template.New("message.tmpl").Funcs(templateFuncMap).ParseFiles(viper.GetString("app.template_file"))