From adbe37475495a7faad774a29d93b777a41076040 Mon Sep 17 00:00:00 2001 From: Armand Grillet <2117580+armandgrillet@users.noreply.github.com> Date: Fri, 15 Apr 2022 09:57:45 +0200 Subject: [PATCH] Alerting: fix SCC-S1017 linting issue in codebase (#47683) --- pkg/services/alerting/notifiers/hipchat.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/services/alerting/notifiers/hipchat.go b/pkg/services/alerting/notifiers/hipchat.go index 7a21903fb6c..78a141cea7e 100644 --- a/pkg/services/alerting/notifiers/hipchat.go +++ b/pkg/services/alerting/notifiers/hipchat.go @@ -55,9 +55,7 @@ const ( // for the HipChatNotifier func NewHipChatNotifier(model *models.AlertNotification, _ alerting.GetDecryptedValueFn, ns notifications.Service) (alerting.Notifier, error) { url := model.Settings.Get("url").MustString() - if strings.HasSuffix(url, "/") { - url = url[:len(url)-1] - } + url = strings.TrimSuffix(url, "/") if url == "" { return nil, alerting.ValidationError{Reason: "Could not find url property in settings"} }