Skip to content

Commit aaf5592

Browse files
committed
fix lint
Signed-off-by: SungJin1212 <[email protected]>
1 parent 0f19e28 commit aaf5592

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pkg/ingester/ingester_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7081,7 +7081,7 @@ func CreateBlock(t *testing.T, ctx context.Context, dir string, mint, maxt int64
70817081

70827082
type panickingMatchersCache struct{}
70837083

7084-
func (_ *panickingMatchersCache) GetOrSet(_ storecache.ConversionLabelMatcher, _ storecache.NewItemFunc) (*labels.Matcher, error) {
7084+
func (*panickingMatchersCache) GetOrSet(_ storecache.ConversionLabelMatcher, _ storecache.NewItemFunc) (*labels.Matcher, error) {
70857085
var a []int
70867086
a[1] = 2 // index out of range
70877087
return nil, nil

pkg/querier/distributor_queryable_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ func TestDistributorQuerier_Retry(t *testing.T) {
314314
t.Run(name, func(t *testing.T) {
315315
d := &MockDistributor{}
316316

317-
if tc.api == "Select" {
317+
switch tc.api {
318+
case "Select":
318319
promChunk := util.GenerateChunk(t, time.Second, model.TimeFromUnix(time.Now().Unix()), 10, promchunk.PrometheusXorChunk)
319320
clientChunks, err := chunkcompat.ToChunks([]chunk.Chunk{promChunk})
320321
require.NoError(t, err)
@@ -331,13 +332,13 @@ func TestDistributorQuerier_Retry(t *testing.T) {
331332
},
332333
}, err).Once()
333334
}
334-
} else if tc.api == "LabelNames" {
335+
case "LabelNames":
335336
res := []string{"foo"}
336337
for _, err := range tc.errors {
337338
d.On("LabelNamesStream", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(res, err).Once()
338339
d.On("LabelNames", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(res, err).Once()
339340
}
340-
} else if tc.api == "LabelValues" {
341+
case "LabelValues":
341342
res := []string{"foo"}
342343
for _, err := range tc.errors {
343344
d.On("LabelValuesForLabelNameStream", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(res, err).Once()
@@ -366,9 +367,10 @@ func TestDistributorQuerier_Retry(t *testing.T) {
366367
} else {
367368
var annots annotations.Annotations
368369
var err error
369-
if tc.api == "LabelNames" {
370+
switch tc.api {
371+
case "LabelNames":
370372
_, annots, err = querier.LabelNames(ctx, nil, labels.MustNewMatcher(labels.MatchEqual, "foo", "bar"))
371-
} else if tc.api == "LabelValues" {
373+
case "LabelValues":
372374
_, annots, err = querier.LabelValues(ctx, "foo", nil, labels.MustNewMatcher(labels.MatchEqual, "foo", "bar"))
373375
}
374376

0 commit comments

Comments
 (0)