Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.64.5
version: v2.0.2
2 changes: 1 addition & 1 deletion pkg/cdi/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (w *watch) stop() {
return
}

w.watcher.Close()
_ = w.watcher.Close()
w.tracked = nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cdi/cache_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (em *emfile) undo() error {
return err
}
for _, fd := range em.fds {
syscall.Close(fd)
_ = syscall.Close(fd)
}
em.undone = true

Expand Down
2 changes: 1 addition & 1 deletion pkg/cdi/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ func updateSpecDirs(dir string, etc, run map[string]string) error {
path := filepath.Join(dir, sub)
for name, data := range entries {
if data == "remove" {
os.Remove(filepath.Join(path, name))
_ = os.Remove(filepath.Join(path, name))
} else {
updates[sub][name] = data
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/cdi/regressions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ containerEdits:

cdiDir, err := writeFilesToTempDir("containerd-test-CDI-injections-", test.cdiSpecFiles)
if cdiDir != "" {
defer os.RemoveAll(cdiDir)
defer func() {
_ = os.RemoveAll(cdiDir)
}()
}
require.NoError(t, err)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cdi/spec-dirs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func mkTestDir(t *testing.T, dirs map[string]map[string]string) (string, error)
}

t.Cleanup(func() {
os.RemoveAll(tmp)
_ = os.RemoveAll(tmp)
})

if err = updateTestDir(tmp, dirs); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cdi/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ func (s *Spec) write(overwrite bool) error {
return fmt.Errorf("failed to create Spec file: %w", err)
}
_, err = tmp.Write(data)
tmp.Close()
_ = tmp.Close()
if err != nil {
return fmt.Errorf("failed to write Spec file: %w", err)
}

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

if err != nil {
os.Remove(tmp.Name())
_ = os.Remove(tmp.Name())
err = fmt.Errorf("failed to write Spec file: %w", err)
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/cdi/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func renameIn(dir, src, dst string, overwrite bool) error {
if err != nil {
return fmt.Errorf("rename failed: %w", err)
}
defer dirf.Close()
defer func() {
_ = dirf.Close()
}()

if !overwrite {
flags = unix.RENAME_NOREPLACE
Expand Down
4 changes: 2 additions & 2 deletions pkg/cdi/spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,10 @@ func mkTestSpec(t *testing.T, data []byte) (string, error) {

file := tmp.Name()
t.Cleanup(func() {
os.Remove(file)
_ = os.Remove(file)
})

tmp.Close()
_ = tmp.Close()
return file, nil
}

Expand Down
Loading