Skip to content

Commit b665c91

Browse files
committed
fix: scopelint for test files
1 parent fb93c5f commit b665c91

File tree

83 files changed

+5
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+5
-148
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ issues:
294294
- predeclared
295295
- path: _test\.go
296296
linters:
297+
- scopelint
297298
- funlen
298299
- unused
299300
- unparam

balancers/config_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ func TestFromConfig(t *testing.T) {
132132
},
133133
},
134134
} {
135-
tt := tt
136135
t.Run(tt.name, func(t *testing.T) {
137136
var (
138137
actErr error

driver_string_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ func TestDriver_String(t *testing.T) {
6565
s: `Driver{Endpoint:"localhost",Database:"local",Secure:true,Credentials:AccessToken{Token:"****(CRC-32c: 9F26E847)",From:"github.com/ydb-platform/ydb-go-sdk/v3/credentials.NewAccessTokenCredentials(credentials.go:20)"}}`, //nolint:lll
6666
},
6767
} {
68-
tt := tt
6968
t.Run(tt.name, func(t *testing.T) {
7069
require.Equal(t, tt.s, tt.d.String())
7170
})

examples/ttl/series.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ func createTables(ctx context.Context, c table.Client, prefix string) (err error
268268
}
269269

270270
for i := 0; i < expirationQueueCount; i++ {
271-
i := i
272271
err = c.Do(ctx,
273272
func(ctx context.Context, s table.Session) error {
274273
return s.CreateTable(ctx, path.Join(prefix, fmt.Sprintf("expiration_queue_%v", i)),

internal/backoff/backoff_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func TestDelays(t *testing.T) {
3535
7: duration("32s"),
3636
8: duration("32s"),
3737
} {
38-
i, d := i, d
3938
t.Run(fmt.Sprintf("%v -> %v", i, d), func(t *testing.T) {
4039
require.Equal(t, d, b.Delay(i))
4140
})
@@ -129,7 +128,6 @@ func TestLogBackoff(t *testing.T) {
129128
},
130129
},
131130
} {
132-
tt := tt
133131
t.Run("", func(t *testing.T) {
134132
if tt.seeds == 0 {
135133
tt.seeds = 1
@@ -216,7 +214,6 @@ func TestFastSlowDelaysWithoutJitter(t *testing.T) {
216214
},
217215
},
218216
} {
219-
tt := tt
220217
t.Run(tt.name, func(t *testing.T) {
221218
for n, exp := range tt.exp {
222219
n, exp := n, exp

internal/balancer/balancer_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ func TestEndpointsDiff(t *testing.T) {
115115
},
116116
},
117117
} {
118-
tt := tt
119118
t.Run(xtest.CurrentFileLine(), func(t *testing.T) {
120119
nodes, added, dropped := endpointsDiff(tt.newestEndpoints, tt.previousConns)
121120
require.Equal(t, tt.nodes, nodes)

internal/balancer/connections_state_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func TestConnsToNodeIDMap(t *testing.T) {
5959
}
6060

6161
for _, test := range table {
62-
test := test
6362
t.Run(test.name, func(t *testing.T) {
6463
require.Equal(t, test.res, connsToNodeIDMap(test.source))
6564
})
@@ -149,7 +148,6 @@ func TestSortPreferConnections(t *testing.T) {
149148
}
150149

151150
for _, test := range table {
152-
test := test
153151
t.Run(test.name, func(t *testing.T) {
154152
prefer, fallback := sortPreferConnections(test.source, test.filter, balancerConfig.Info{}, test.allowFallback)
155153
require.Equal(t, test.prefer, prefer)

internal/balancer/local_dc_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ func TestExtractHostPort(t *testing.T) {
195195
},
196196
}
197197
for _, test := range table {
198-
test := test
199198
t.Run(test.name, func(t *testing.T) {
200199
host, port, err := extractHostPort(test.address)
201200
require.Equal(t, test.host, host)

internal/bind/bind_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func TestSort(t *testing.T) {
2424
},
2525
},
2626
} {
27-
tt := tt
2827
t.Run("", func(t *testing.T) {
2928
require.Equal(t, tt.sorted, Sort(tt.bindings))
3029
})

internal/bind/numeric_args_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ SELECT $p0, $p1`,
313313
},
314314
},
315315
} {
316-
tt := tt
317316
t.Run("", func(t *testing.T) {
318317
yql, params, err := b.RewriteQuery(tt.sql, tt.args...)
319318
if tt.err != nil {

0 commit comments

Comments
 (0)