diff --git a/model/textparse/openmetricsparse_test.go b/model/textparse/openmetricsparse_test.go index 9453db5d5f..68b7fea8a0 100644 --- a/model/textparse/openmetricsparse_test.go +++ b/model/textparse/openmetricsparse_test.go @@ -246,7 +246,6 @@ foo_total 17.0 1520879607.789 # {xx="yy"} 5` require.Equal(t, true, found) require.Equal(t, *exp[i].e, e) } - res = res[:0] case EntryType: m, typ := p.Type() diff --git a/model/textparse/promparse_test.go b/model/textparse/promparse_test.go index 6a1216da16..dadad34495 100644 --- a/model/textparse/promparse_test.go +++ b/model/textparse/promparse_test.go @@ -192,7 +192,6 @@ testmetric{label="\"bar\""} 1` require.Equal(t, exp[i].t, ts) require.Equal(t, exp[i].v, v) require.Equal(t, exp[i].lset, res) - res = res[:0] case EntryType: m, typ := p.Type() @@ -414,7 +413,7 @@ func BenchmarkParse(b *testing.B) { case EntrySeries: m, _, _ := p.Series() - res := make(labels.Labels, 0, 5) + var res labels.Labels p.Metric(&res) total += len(m) @@ -426,7 +425,7 @@ func BenchmarkParse(b *testing.B) { }) b.Run(parserName+"/decode-metric-reuse/"+fn, func(b *testing.B) { total := 0 - res := make(labels.Labels, 0, 5) + var res labels.Labels b.SetBytes(int64(len(buf) / promtestdataSampleCount)) b.ReportAllocs() @@ -451,7 +450,6 @@ func BenchmarkParse(b *testing.B) { total += len(m) i++ - res = res[:0] } } } diff --git a/model/textparse/protobufparse_test.go b/model/textparse/protobufparse_test.go index 33826ad8e1..b8b8681724 100644 --- a/model/textparse/protobufparse_test.go +++ b/model/textparse/protobufparse_test.go @@ -630,7 +630,6 @@ metric: < require.Equal(t, true, found) require.Equal(t, exp[i].e[0], e) } - res = res[:0] case EntryHistogram: m, ts, shs, fhs := p.Histogram() @@ -642,7 +641,6 @@ metric: < require.Equal(t, exp[i].t, int64(0)) } require.Equal(t, exp[i].lset, res) - res = res[:0] require.Equal(t, exp[i].m, string(m)) if shs != nil { require.Equal(t, exp[i].shs, shs)