Alerting: fix SCC-S1017 linting issue in codebase (#47683)

This commit is contained in:
Armand Grillet
2022-04-15 09:57:45 +02:00
committed by GitHub
parent 508cc58a63
commit adbe374754

View File

@@ -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"}
}