ci: bump golangci-lint to v2.15

Fix new errcheck warnings about unchecked errors received from channels:

  libcontainer/configs/config.go:632:3: Error return value is not checked (errcheck)
  libcontainer/logs/logs_linux_test.go:62:7: Error return value is not checked (errcheck)
  notify_socket_test.go:73:7: Error return value is not checked (errcheck)

In the hook timeout case, the error from Wait is expected after Kill,
so add a nolint annotation (using "_ =" upsets staticcheck's S1005).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin committed 2026-10-27 12:57:26 -07:00
1 parent 4115307e88
commit 3e06aff566
4 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ jobs:
sudo apt -qy install libseccomp-dev
- uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.13
version: v2.15
skip-cache: true
# Extra linters, only checking new code from a pull request to main.
- name: lint-extra
+1 -1
View File
@@ -629,7 +629,7 @@ func (c *Command) Run(s *specs.State) error {
return err
case <-timerCh:
_ = cmd.Process.Kill()
<-errC
<-errC //nolint:errcheck // Wait error is expected after Kill.
return fmt.Errorf("hook ran past specified timeout of %.1fs", c.Timeout.Seconds())
}
}
+4 -1
View File
@@ -59,7 +59,10 @@ func TestLogForwardingStopsAfterClosingTheWriter(t *testing.T) {
// Do not use finish() here as we check done pipe ourselves.
l.w.Close()
select {
case <-l.done:
case err := <-l.done:
if err != nil {
t.Fatal(err)
}
case <-time.After(10 * time.Second):
t.Fatal("log forwarding did not stop after closing the pipe")
}
+2 -2
View File
@@ -70,8 +70,8 @@ func expectBarrier(t *testing.T, conn *net.UnixConn, notifyHostChan <-chan error
case <-timer.C:
// this is the expected case
break
case <-notifyHostChan:
t.Fatal("runc has terminated before barrier was lifted")
case err := <-notifyHostChan:
t.Fatalf("runc has terminated before barrier was lifted (err: %v)", err)
}
// Lift the barrier