From 886caf2699884c1a219721e11e6f6b9381d02b18 Mon Sep 17 00:00:00 2001 From: Ayan George Date: Sun, 17 May 2020 21:40:12 -0400 Subject: [PATCH] fix(tsdb): Fix variables masked by a declaration (#18129) Before this commit, the to and from variables were being re-declared in a block in such a way that the values were not being used. This patch uses regular assignment so that the values are visable outside of the block where they're set. Closes: 18128 --- tsdb/store_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsdb/store_test.go b/tsdb/store_test.go index d981ad589ec..e05a19e0949 100644 --- a/tsdb/store_test.go +++ b/tsdb/store_test.go @@ -1054,7 +1054,7 @@ func testStoreCardinalityDuplicates(t *testing.T, store *Store) { // For other shards we write a random sub-section of all the points. // which will duplicate the series and shouldn't increase the // cardinality. - from, to := rand.Intn(len(points)), rand.Intn(len(points)) + from, to = rand.Intn(len(points)), rand.Intn(len(points)) if from > to { from, to = to, from }