Commit ba8c02f5 by Torkel Ödegaard

refactor: changed string slicing to strings.TrimPrefix, #9862

parent 9ad186bc
......@@ -94,9 +94,9 @@ func HandleAlertsQuery(query *m.GetAlertsQuery) error {
if i > 0 {
sql.WriteString(" OR ")
}
if strings.HasPrefix(v, "not") {
if strings.HasPrefix(v, "not_") {
sql.WriteString("state <> ? ")
v = v[4:]
v = strings.TrimPrefix(v, "not_")
} else {
sql.WriteString("state = ? ")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment