diff options
author | Wim <wim@42.be> | 2022-04-25 23:50:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 23:50:10 +0200 |
commit | 67adad3e08fe17d5f7e87468ea47aa76e1662255 (patch) | |
tree | 91314fac90d39254e66ae794decfcd21c10a7b20 /vendor/github.com/slack-go/slack/slackutilsx | |
parent | 2fca3c756373577eab4e0120ccce62eecc1f5ad8 (diff) | |
download | matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.gz matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.bz2 matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.zip |
Update dependencies (#1813)
Diffstat (limited to 'vendor/github.com/slack-go/slack/slackutilsx')
-rw-r--r-- | vendor/github.com/slack-go/slack/slackutilsx/slackutilsx.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/github.com/slack-go/slack/slackutilsx/slackutilsx.go b/vendor/github.com/slack-go/slack/slackutilsx/slackutilsx.go index 1f7b2b8c..d6c9c07e 100644 --- a/vendor/github.com/slack-go/slack/slackutilsx/slackutilsx.go +++ b/vendor/github.com/slack-go/slack/slackutilsx/slackutilsx.go @@ -50,10 +50,12 @@ func DetectChannelType(channelID string) ChannelType { } } +// initialize replacer only once (if needed) +var escapeReplacer = strings.NewReplacer("&", "&", "<", "<", ">", ">") + // EscapeMessage text func EscapeMessage(message string) string { - replacer := strings.NewReplacer("&", "&", "<", "<", ">", ">") - return replacer.Replace(message) + return escapeReplacer.Replace(message) } // Retryable errors return true. |