Skip to content

Commit 2370a28

Browse files
ktockestesp
authored andcommitted
Fix linter issues for golangci-lint 1.54.2
Signed-off-by: Kohei Tokunaga <[email protected]> (cherry picked from commit 6169433)
1 parent 8a65e2e commit 2370a28

5 files changed

Lines changed: 5 additions & 1 deletion

File tree

content/helpers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ func TestCopy(t *testing.T) {
144144
}
145145

146146
for _, testcase := range testcases {
147+
testcase := testcase
147148
t.Run(testcase.name, func(t *testing.T) {
148149
err := Copy(context.Background(),
149150
&testcase.writer,

metadata/containers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ func TestContainersCreateUpdateDelete(t *testing.T) {
625625
},
626626
},
627627
} {
628+
testcase := testcase
628629
t.Run(testcase.name, func(t *testing.T) {
629630
testcase.original.ID = testcase.name
630631
if testcase.input.ID == "" {

metadata/images_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ func TestImagesCreateUpdateDelete(t *testing.T) {
481481
cause: errdefs.ErrNotFound,
482482
},
483483
} {
484+
testcase := testcase
484485
t.Run(testcase.name, func(t *testing.T) {
485486
testcase.original.Name = testcase.name
486487
if testcase.input.Name == "" {

metrics/cgroups/v1/oom.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func (o *oomCollector) Collect(ch chan<- prometheus.Metric) {
9999
o.mu.Lock()
100100
defer o.mu.Unlock()
101101
for _, t := range o.set {
102+
t := t
102103
c := atomic.LoadInt64(&t.count)
103104
ch <- prometheus.MustNewConstMetric(o.desc, prometheus.CounterValue, float64(c), t.id, t.namespace)
104105
}

pkg/cri/server/image_status_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
func TestImageStatus(t *testing.T) {
32-
testID := "sha256:d848ce12891bf78792cda4a23c58984033b0c397a55e93a1556202222ecc5ed4"
32+
testID := "sha256:d848ce12891bf78792cda4a23c58984033b0c397a55e93a1556202222ecc5ed4" // #nosec G101
3333
image := imagestore.Image{
3434
ID: testID,
3535
ChainID: "test-chain-id",

0 commit comments

Comments
 (0)