Skip to content

Commit a47d64b

Browse files
committed
Remove strange variable construct in alerts.go
1 parent 6bc0cb8 commit a47d64b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/alert.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ inactive = 0`,
5959
| total=2 firing=1 pending=0 inactive=1`,
6060
Run: func(cmd *cobra.Command, args []string) {
6161
var (
62-
states []int
6362
output strings.Builder
6463
summary string
6564
counterFiring int
@@ -92,7 +91,7 @@ inactive = 0`,
9291
for _, rl := range rules {
9392
l *= len(rl.AlertingRule.Alerts)
9493
}
95-
rStates := make([]int, 0, l)
94+
states := make([]int, 0, l)
9695

9796
for _, rl := range rules {
9897

@@ -121,7 +120,7 @@ inactive = 0`,
121120
}
122121

123122
// Gather the state to evaluate the worst at the end
124-
rStates = append(states, rl.GetStatus())
123+
states = append(states, rl.GetStatus())
125124
output.WriteString(generateOutput(rl, cliAlertConfig))
126125
}
127126

@@ -142,12 +141,11 @@ inactive = 0`,
142141
// Set the alert in the internal Type to generate the output
143142
rl.Alert = alert
144143
// Gather the state to evaluate the worst at the end
145-
rStates = append(states, rl.GetStatus())
144+
states = append(states, rl.GetStatus())
146145
output.WriteString(generateOutput(rl, cliAlertConfig))
147146
}
148147
}
149148
}
150-
states = rStates
151149

152150
counterAlert := counterFiring + counterPending + counterInactive
153151
if len(cliAlertConfig.AlertName) > 1 || counterAlert > 1 {

0 commit comments

Comments
 (0)