From 0c68b655f6c491697d20c06bc64e2bcc132872ee Mon Sep 17 00:00:00 2001 From: Cory Snider Date: Fri, 3 Feb 2023 12:27:37 -0500 Subject: [PATCH] Fix loop-closure bugs in tests ...which were flagged by golangci-lint v1.51. Signed-off-by: Cory Snider --- distribution/xfer/download_test.go | 1 + integration/build/build_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/distribution/xfer/download_test.go b/distribution/xfer/download_test.go index 3b4a6a9df9..ced9575fb0 100644 --- a/distribution/xfer/download_test.go +++ b/distribution/xfer/download_test.go @@ -389,6 +389,7 @@ func TestMaxDownloadAttempts(t *testing.T) { }, } for _, tc := range tests { + tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() layerStore := &mockLayerStore{make(map[layer.ChainID]*mockLayer)} diff --git a/integration/build/build_test.go b/integration/build/build_test.go index 5da3a294a1..589ebc0a77 100644 --- a/integration/build/build_test.go +++ b/integration/build/build_test.go @@ -90,6 +90,7 @@ func TestBuildWithRemoveAndForceRemove(t *testing.T) { client := testEnv.APIClient() ctx := context.Background() for _, c := range cases { + c := c t.Run(c.name, func(t *testing.T) { t.Parallel() dockerfile := []byte(c.dockerfile)