Chore: Fix staticcheck issues (#28854)
* Chore: Fix issues reported by staticcheck Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Undo changes Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -390,7 +390,7 @@ func UpdateAlertNotification(cmd *models.UpdateAlertNotificationCommand) error {
|
||||
}
|
||||
|
||||
if sameNameQuery.Result != nil && sameNameQuery.Result.Id != current.Id {
|
||||
return fmt.Errorf("Alert notification name %s already exists", cmd.Name)
|
||||
return fmt.Errorf("alert notification name %q already exists", cmd.Name)
|
||||
}
|
||||
|
||||
// delete empty keys
|
||||
@@ -431,7 +431,7 @@ func UpdateAlertNotification(cmd *models.UpdateAlertNotificationCommand) error {
|
||||
if affected, err := sess.ID(cmd.Id).Update(current); err != nil {
|
||||
return err
|
||||
} else if affected == 0 {
|
||||
return fmt.Errorf("Could not update alert notification")
|
||||
return fmt.Errorf("could not update alert notification")
|
||||
}
|
||||
|
||||
cmd.Result = ¤t
|
||||
@@ -578,7 +578,7 @@ func GetOrCreateAlertNotificationState(ctx context.Context, cmd *models.GetOrCre
|
||||
}
|
||||
|
||||
if !exist {
|
||||
return errors.New("Should not happen")
|
||||
return errors.New("should not happen")
|
||||
}
|
||||
|
||||
cmd.Result = nj
|
||||
|
||||
Reference in New Issue
Block a user