Skip to content

Commit e16f542

Browse files
authored
chore: add support for copyloopvar linter (#2709)
1 parent d1f475a commit e16f542

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

.golangci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ linters:
99
- bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false]
1010
- containedctx # containedctx is a linter that detects struct contained context.Context field [fast: true, auto-fix: false]
1111
- contextcheck # check the function whether use a non-inherited context [fast: false, auto-fix: false]
12+
- copyloopvar # copyloopvar is a linter detects places where loop variables are copied [fast: true, auto-fix: false]
1213
- decorder # check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false]
1314
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
1415
- dupword # checks for duplicate words in the source code [fast: true, auto-fix: true]

internal/services/object/helpers_object.go

-4
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,6 @@ func deleteS3ObjectVersions(ctx context.Context, conn *s3.S3, bucketName string,
372372
pool := workerpool.NewWorkerPool(deletionWorkers)
373373

374374
for _, objectVersion := range page.Versions {
375-
objectVersion := objectVersion
376-
377375
pool.AddTask(func() error {
378376
objectKey := aws.StringValue(objectVersion.Key)
379377
objectVersionID := aws.StringValue(objectVersion.VersionId)
@@ -417,8 +415,6 @@ func deleteS3ObjectVersions(ctx context.Context, conn *s3.S3, bucketName string,
417415
pool := workerpool.NewWorkerPool(deletionWorkers)
418416

419417
for _, deleteMarkerEntry := range page.DeleteMarkers {
420-
deleteMarkerEntry := deleteMarkerEntry
421-
422418
pool.AddTask(func() error {
423419
deleteMarkerKey := aws.StringValue(deleteMarkerEntry.Key)
424420
deleteMarkerVersionsID := aws.StringValue(deleteMarkerEntry.VersionId)

0 commit comments

Comments
 (0)