Skip to content

Commit 22d5b35

Browse files
authored
Merge pull request #266 from cncf-tags/dependabot/github_actions/golangci/golangci-lint-action-7
Bump golangci/golangci-lint-action from 6 to 7
2 parents 58d2f91 + 24147ba commit 22d5b35

9 files changed

+16
-12
lines changed

Diff for: .github/workflows/golangci-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
with:
2525
go-version: stable
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v6
27+
uses: golangci/golangci-lint-action@v7
2828
with:
29-
version: v1.64.5
29+
version: v2.0.2

Diff for: pkg/cdi/cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ func (w *watch) stop() {
520520
return
521521
}
522522

523-
w.watcher.Close()
523+
_ = w.watcher.Close()
524524
w.tracked = nil
525525
}
526526

Diff for: pkg/cdi/cache_linux_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (em *emfile) undo() error {
229229
return err
230230
}
231231
for _, fd := range em.fds {
232-
syscall.Close(fd)
232+
_ = syscall.Close(fd)
233233
}
234234
em.undone = true
235235

Diff for: pkg/cdi/cache_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ func updateSpecDirs(dir string, etc, run map[string]string) error {
18601860
path := filepath.Join(dir, sub)
18611861
for name, data := range entries {
18621862
if data == "remove" {
1863-
os.Remove(filepath.Join(path, name))
1863+
_ = os.Remove(filepath.Join(path, name))
18641864
} else {
18651865
updates[sub][name] = data
18661866
}

Diff for: pkg/cdi/regressions_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ containerEdits:
111111

112112
cdiDir, err := writeFilesToTempDir("containerd-test-CDI-injections-", test.cdiSpecFiles)
113113
if cdiDir != "" {
114-
defer os.RemoveAll(cdiDir)
114+
defer func() {
115+
_ = os.RemoveAll(cdiDir)
116+
}()
115117
}
116118
require.NoError(t, err)
117119

Diff for: pkg/cdi/spec-dirs_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func mkTestDir(t *testing.T, dirs map[string]map[string]string) (string, error)
216216
}
217217

218218
t.Cleanup(func() {
219-
os.RemoveAll(tmp)
219+
_ = os.RemoveAll(tmp)
220220
})
221221

222222
if err = updateTestDir(tmp, dirs); err != nil {

Diff for: pkg/cdi/spec.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ func (s *Spec) write(overwrite bool) error {
156156
return fmt.Errorf("failed to create Spec file: %w", err)
157157
}
158158
_, err = tmp.Write(data)
159-
tmp.Close()
159+
_ = tmp.Close()
160160
if err != nil {
161161
return fmt.Errorf("failed to write Spec file: %w", err)
162162
}
163163

164164
err = renameIn(dir, filepath.Base(tmp.Name()), filepath.Base(s.path), overwrite)
165165

166166
if err != nil {
167-
os.Remove(tmp.Name())
167+
_ = os.Remove(tmp.Name())
168168
err = fmt.Errorf("failed to write Spec file: %w", err)
169169
}
170170

Diff for: pkg/cdi/spec_linux.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ func renameIn(dir, src, dst string, overwrite bool) error {
3232
if err != nil {
3333
return fmt.Errorf("rename failed: %w", err)
3434
}
35-
defer dirf.Close()
35+
defer func() {
36+
_ = dirf.Close()
37+
}()
3638

3739
if !overwrite {
3840
flags = unix.RENAME_NOREPLACE

Diff for: pkg/cdi/spec_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,10 @@ func mkTestSpec(t *testing.T, data []byte) (string, error) {
504504

505505
file := tmp.Name()
506506
t.Cleanup(func() {
507-
os.Remove(file)
507+
_ = os.Remove(file)
508508
})
509509

510-
tmp.Close()
510+
_ = tmp.Close()
511511
return file, nil
512512
}
513513

0 commit comments

Comments
 (0)