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:
Arve Knudsen
2020-11-05 11:57:20 +01:00
committed by GitHub
parent 9b90ff2961
commit 7897c6b7d5
24 changed files with 53 additions and 55 deletions
+3 -3
View File
@@ -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 = &current
@@ -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