Merge pull request #1672 from aixeshunter/master

Unused function 'QTimeRange' and empty slice declaration via literal
This commit is contained in:
stuart nelson 2019-05-03 14:13:04 +02:00 committed by GitHub
commit b3972f3adc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 12 deletions

View File

@ -599,8 +599,6 @@ type query struct {
// should be dropped from a result set for a given time.
type silenceFilter func(*pb.Silence, *Silences, time.Time) (bool, error)
var errNotSupported = errors.New("query parameter not supported")
// QIDs configures a query to select the given silence IDs.
func QIDs(ids ...string) QueryParam {
return func(q *query) error {
@ -609,15 +607,6 @@ func QIDs(ids ...string) QueryParam {
}
}
// QTimeRange configures a query to search for silences that are active
// in the given time range.
// TODO(fabxc): not supported yet.
func QTimeRange(start, end time.Time) QueryParam {
return func(q *query) error {
return errNotSupported
}
}
// QMatches returns silences that match the given label set.
func QMatches(set model.LabelSet) QueryParam {
return func(q *query) error {

View File

@ -81,7 +81,7 @@ func (a *Alerts) gc() {
a.Lock()
defer a.Unlock()
resolved := []*types.Alert{}
var resolved []*types.Alert
for fp, alert := range a.c {
if alert.Resolved() {
delete(a.c, fp)