From f3d9a5b0ec08e27fbdfed910081aa66bec4540bf Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 13 May 2020 11:46:05 +0300 Subject: [PATCH] app/vmselect/promql: suppress "SA4006: this value of `dstValues` is never used" error in golangci-lint --- app/vmselect/promql/aggr_incremental.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/vmselect/promql/aggr_incremental.go b/app/vmselect/promql/aggr_incremental.go index 10ff4ccea..c9d058b3e 100644 --- a/app/vmselect/promql/aggr_incremental.go +++ b/app/vmselect/promql/aggr_incremental.go @@ -465,7 +465,6 @@ func finalizeAggrGeomean(iac *incrementalAggrContext) { } func updateAggrAny(iac *incrementalAggrContext, values []float64) { - dstValues := iac.ts.Values dstCounts := iac.values if dstCounts[0] > 0 { return @@ -473,17 +472,16 @@ func updateAggrAny(iac *incrementalAggrContext, values []float64) { for i := range values { dstCounts[i] = 1 } - dstValues = append(dstValues[:0], values...) + iac.ts.Values = append(iac.ts.Values[:0], values...) } func mergeAggrAny(dst, src *incrementalAggrContext) { srcValues := src.ts.Values - dstValues := dst.ts.Values srcCounts := src.values dstCounts := dst.values if dstCounts[0] > 0 { return } dstCounts[0] = srcCounts[0] - dstValues = append(dstValues[:0], srcValues...) + dst.ts.Values = append(dst.ts.Values[:0], srcValues...) }