diff options
author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2022-03-06 16:33:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 16:33:55 +0800 |
commit | 5afca6ca8eaadebc613dce291da2bae1030ccca9 (patch) | |
tree | 46f86403c6abdeabd6172ee5243caa3bfe5a79a4 /internal/db/webhook_slack.go | |
parent | deec3516d53e9a9679128ade0556ccc818a67be1 (diff) |
autofix: function call can be replaced with helper function (#6805)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/db/webhook_slack.go')
-rw-r--r-- | internal/db/webhook_slack.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/db/webhook_slack.go b/internal/db/webhook_slack.go index 289bcb28..adc75587 100644 --- a/internal/db/webhook_slack.go +++ b/internal/db/webhook_slack.go @@ -51,18 +51,18 @@ func (p *SlackPayload) JSONPayload() ([]byte, error) { // see: https://api.slack.com/docs/formatting func SlackTextFormatter(s string) string { // replace & < > - s = strings.Replace(s, "&", "&", -1) - s = strings.Replace(s, "<", "<", -1) - s = strings.Replace(s, ">", ">", -1) + s = strings.ReplaceAll(s, "&", "&") + s = strings.ReplaceAll(s, "<", "<") + s = strings.ReplaceAll(s, ">", ">") return s } func SlackShortTextFormatter(s string) string { s = strings.Split(s, "\n")[0] // replace & < > - s = strings.Replace(s, "&", "&", -1) - s = strings.Replace(s, "<", "<", -1) - s = strings.Replace(s, ">", ">", -1) + s = strings.ReplaceAll(s, "&", "&") + s = strings.ReplaceAll(s, "<", "<") + s = strings.ReplaceAll(s, ">", ">") return s } |