Skip to content

Commit

Permalink
Fix linter issues for golangci-lint 1.54.2
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
(cherry picked from commit 6169433)
  • Loading branch information
ktock authored and estesp committed Dec 1, 2023
1 parent 8a65e2e commit 2370a28
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions content/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ func TestCopy(t *testing.T) {
}

for _, testcase := range testcases {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
err := Copy(context.Background(),
&testcase.writer,
Expand Down
1 change: 1 addition & 0 deletions metadata/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ func TestContainersCreateUpdateDelete(t *testing.T) {
},
},
} {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
testcase.original.ID = testcase.name
if testcase.input.ID == "" {
Expand Down
1 change: 1 addition & 0 deletions metadata/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ func TestImagesCreateUpdateDelete(t *testing.T) {
cause: errdefs.ErrNotFound,
},
} {
testcase := testcase
t.Run(testcase.name, func(t *testing.T) {
testcase.original.Name = testcase.name
if testcase.input.Name == "" {
Expand Down
1 change: 1 addition & 0 deletions metrics/cgroups/v1/oom.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (o *oomCollector) Collect(ch chan<- prometheus.Metric) {
o.mu.Lock()
defer o.mu.Unlock()
for _, t := range o.set {
t := t
c := atomic.LoadInt64(&t.count)
ch <- prometheus.MustNewConstMetric(o.desc, prometheus.CounterValue, float64(c), t.id, t.namespace)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/server/image_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

func TestImageStatus(t *testing.T) {
testID := "sha256:d848ce12891bf78792cda4a23c58984033b0c397a55e93a1556202222ecc5ed4"
testID := "sha256:d848ce12891bf78792cda4a23c58984033b0c397a55e93a1556202222ecc5ed4" // #nosec G101
image := imagestore.Image{
ID: testID,
ChainID: "test-chain-id",
Expand Down

0 comments on commit 2370a28

Please sign in to comment.