mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
go meta lint errors
This commit is contained in:
@@ -125,7 +125,7 @@ func (c *EvalContext) GetNewState() m.AlertStateType {
|
|||||||
return ns
|
return ns
|
||||||
}
|
}
|
||||||
|
|
||||||
since := time.Now().Sub(c.Rule.LastStateChange)
|
since := time.Since(c.Rule.LastStateChange)
|
||||||
if c.PrevAlertState == m.AlertStatePending && since > c.Rule.For {
|
if c.PrevAlertState == m.AlertStatePending && since > c.Rule.For {
|
||||||
return m.AlertStateAlerting
|
return m.AlertStateAlerting
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ func TestGetStateFromEvalContext(t *testing.T) {
|
|||||||
name string
|
name string
|
||||||
expected models.AlertStateType
|
expected models.AlertStateType
|
||||||
applyFn func(ec *EvalContext)
|
applyFn func(ec *EvalContext)
|
||||||
focus bool
|
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "ok -> alerting",
|
name: "ok -> alerting",
|
||||||
|
|||||||
Reference in New Issue
Block a user