From 7b44c1793133c279f09d013a4a02131cae673c9b Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Mon, 25 Apr 2022 16:24:03 +0100 Subject: [PATCH] Return err without any checks as suggested --- pkg/querier/querier.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pkg/querier/querier.go b/pkg/querier/querier.go index b6742b93c9b9a..2af79ec9e0ab7 100644 --- a/pkg/querier/querier.go +++ b/pkg/querier/querier.go @@ -378,23 +378,18 @@ func (q *SingleTenantQuerier) Label(ctx context.Context, req *logproto.LabelRequ var storeValues []string if !q.cfg.QueryIngesterOnly && storeQueryInterval != nil { g.Go(func() error { - var err error - from := model.TimeFromUnixNano(storeQueryInterval.start.UnixNano()) - through := model.TimeFromUnixNano(storeQueryInterval.end.UnixNano()) + var ( + err error + from = model.TimeFromUnixNano(storeQueryInterval.start.UnixNano()) + through = model.TimeFromUnixNano(storeQueryInterval.end.UnixNano()) + ) if req.Values { storeValues, err = q.store.LabelValuesForMetricName(ctx, userID, from, through, "logs", req.Name) - if err != nil { - return err - } } else { storeValues, err = q.store.LabelNamesForMetricName(ctx, userID, from, through, "logs") - if err != nil { - return err - } } - - return nil + return err }) }