Skip to content

Commit 484c2f9

Browse files
committed
fix: merge conditional assignment for staticcheck QF1007
1 parent 875c7be commit 484c2f9

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

internal/watch/notify.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,8 @@ func (wn *WatchNotifier) NotifyIncident(inc Incident, flap FlappingResult, crash
3131
return nil
3232
}
3333

34-
shouldNotify := false
35-
if flap.IsFlapping && wn.Settings.OnFlapping {
36-
shouldNotify = true
37-
}
38-
if !flap.IsFlapping && wn.Settings.OnIncident {
39-
shouldNotify = true
40-
}
34+
shouldNotify := (flap.IsFlapping && wn.Settings.OnFlapping) ||
35+
(!flap.IsFlapping && wn.Settings.OnIncident)
4136
if !shouldNotify {
4237
return nil
4338
}

0 commit comments

Comments
 (0)