Chore: Fix staticcheck issues (#28860)

* 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>

* Chore: Fix issues reported by staticcheck

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-11-05 13:07:06 +01:00
committed by GitHub
parent 7897c6b7d5
commit 3d3a7cbba8
41 changed files with 125 additions and 124 deletions

View File

@@ -34,7 +34,7 @@ const (
)
var (
ErrCannotChangeStateOnPausedAlert = fmt.Errorf("Cannot change state on pause alert")
ErrCannotChangeStateOnPausedAlert = fmt.Errorf("cannot change state on pause alert")
ErrRequiresNewState = fmt.Errorf("update alert state requires a new state")
)
@@ -97,13 +97,13 @@ func (alert *Alert) ShouldUpdateState(newState AlertStateType) bool {
return alert.State != newState
}
func (this *Alert) ContainsUpdates(other *Alert) bool {
func (a *Alert) ContainsUpdates(other *Alert) bool {
result := false
result = result || this.Name != other.Name
result = result || this.Message != other.Message
result = result || a.Name != other.Name
result = result || a.Message != other.Message
if this.Settings != nil && other.Settings != nil {
json1, err1 := this.Settings.Encode()
if a.Settings != nil && other.Settings != nil {
json1, err1 := a.Settings.Encode()
json2, err2 := other.Settings.Encode()
if err1 != nil || err2 != nil {