Fix: Do not copy reference but map content

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-03-21 14:43:26 +01:00
parent c18f96f889
commit df9a23fec8
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D

View File

@ -14,7 +14,10 @@ import (
func formatMessage(tplString string, m *irc.Message, r *rule, fields map[string]interface{}) (string, error) {
// Create anonymous functions in current context in order to access function variables
messageFunctions := korvike.GetFunctionMap()
messageFunctions := make(template.FuncMap)
for n, f := range korvike.GetFunctionMap() {
messageFunctions[n] = f
}
// Generic functions
messageFunctions["toLower"] = strings.ToLower