From 4deb083823c2a38116ed5df9bc23ce21ca4d23e5 Mon Sep 17 00:00:00 2001 From: aixeshunter Date: Wed, 19 Dec 2018 09:40:45 +0800 Subject: [PATCH 1/2] Unused function 'QTimeRange' Signed-off-by: aixeshunter --- silence/silence.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/silence/silence.go b/silence/silence.go index 4b448170..0357b257 100644 --- a/silence/silence.go +++ b/silence/silence.go @@ -511,8 +511,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 { @@ -521,15 +519,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 { From 6e9209ca39fd928cb74bb95fdeab64ce4f6216af Mon Sep 17 00:00:00 2001 From: aixeshunter Date: Wed, 19 Dec 2018 09:52:24 +0800 Subject: [PATCH 2/2] Empty slice declaration via literal Signed-off-by: aixeshunter --- store/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/store.go b/store/store.go index aa0fd02d..539924d9 100644 --- a/store/store.go +++ b/store/store.go @@ -68,7 +68,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)