From 5afca6ca8eaadebc613dce291da2bae1030ccca9 Mon Sep 17 00:00:00 2001
From: "deepsource-autofix[bot]"
 <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Date: Sun, 6 Mar 2022 16:33:55 +0800
Subject: autofix: function call can be replaced with helper function (#6805)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
---
 internal/db/webhook_slack.go | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'internal/db/webhook_slack.go')

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, "&", "&amp;", -1)
-	s = strings.Replace(s, "<", "&lt;", -1)
-	s = strings.Replace(s, ">", "&gt;", -1)
+	s = strings.ReplaceAll(s, "&", "&amp;")
+	s = strings.ReplaceAll(s, "<", "&lt;")
+	s = strings.ReplaceAll(s, ">", "&gt;")
 	return s
 }
 
 func SlackShortTextFormatter(s string) string {
 	s = strings.Split(s, "\n")[0]
 	// replace & < >
-	s = strings.Replace(s, "&", "&amp;", -1)
-	s = strings.Replace(s, "<", "&lt;", -1)
-	s = strings.Replace(s, ">", "&gt;", -1)
+	s = strings.ReplaceAll(s, "&", "&amp;")
+	s = strings.ReplaceAll(s, "<", "&lt;")
+	s = strings.ReplaceAll(s, ">", "&gt;")
 	return s
 }
 
-- 
cgit v1.2.3