Skip to content

Commit ae8a912

Browse files
committed
Fix loop var capture
1 parent 5e89d05 commit ae8a912

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

coderd/prometheusmetrics/aggregator_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ import (
88
"testing"
99
"time"
1010

11-
"cdr.dev/slog/sloggers/slogtest"
12-
"github.com/coder/coder/v2/coderd/agentmetrics"
1311
"github.com/prometheus/client_golang/prometheus"
1412
dto "github.com/prometheus/client_model/go"
1513
"github.com/stretchr/testify/assert"
1614
"github.com/stretchr/testify/require"
1715

16+
"cdr.dev/slog/sloggers/slogtest"
17+
"github.com/coder/coder/v2/coderd/agentmetrics"
18+
1819
agentproto "github.com/coder/coder/v2/agent/proto"
1920
"github.com/coder/coder/v2/coderd/prometheusmetrics"
2021
"github.com/coder/coder/v2/cryptorand"
@@ -318,7 +319,7 @@ func TestLabelsAggregation(t *testing.T) {
318319
aggregateOn []string
319320
}{
320321
{
321-
name: "label aggregations not specified, keep all (high cardinality, default behaviour)",
322+
name: "label aggregations not specified, keep all (high cardinality, default behavior)",
322323
given: []statCollection{
323324
{
324325
labels: testLabels,
@@ -561,6 +562,8 @@ func TestLabelsAggregation(t *testing.T) {
561562
}
562563

563564
for _, tc := range tests {
565+
tc := tc
566+
564567
t.Run(tc.name, func(t *testing.T) {
565568
t.Parallel()
566569

0 commit comments

Comments
 (0)