build(lint): bump golangci-lint to v2.15.0 and fix what it now reports
Some checks are pending
ci / validate (lint) (push) Waiting to run
ci / validate (relay-lint) (push) Waiting to run
ci / validate (relay-test) (push) Waiting to run
ci / validate (validate-docs) (push) Waiting to run
ci / validate (validate-go-mod) (push) Waiting to run
ci / validate (validate-headers) (push) Waiting to run
ci / validate (validate-mocks) (push) Waiting to run
ci / binary (push) Waiting to run
ci / binary-finalize (push) Blocked by required conditions
ci / bin-image-test (push) Waiting to run
ci / relay-image-test (push) Waiting to run
ci / test (push) Waiting to run
ci / e2e (plugin, oldstable, graphdriver) (push) Waiting to run
ci / e2e (standalone, oldstable, graphdriver) (push) Waiting to run
ci / e2e (plugin, stable, containerd) (push) Waiting to run
ci / e2e (plugin, stable, graphdriver) (push) Waiting to run
ci / e2e (standalone, stable, containerd) (push) Waiting to run
ci / e2e (standalone, stable, graphdriver) (push) Waiting to run
ci / coverage (push) Blocked by required conditions
ci / ci-ok (push) Blocked by required conditions
ci / release (push) Blocked by required conditions
merge / bin-image-prepare (push) Waiting to run
merge / bin-image (push) Blocked by required conditions
merge / relay-image (push) Waiting to run
merge / module-image (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
zizmor / zizmor (push) Waiting to run

The release updates errcheck (1.20 to 1.30) and gocognit (1.2.1 to 1.3.0).
errcheck now reports the receives from an error channel whose value is dropped
on purpose, in three places: waiting for the attach copy to end after the
context is done, draining the container wait channel of a failed hook, and
waiting for Up to return in a test. Say why on each, rather than handling an
error nobody can act on. gocognit's new count is handled by the previous
commit.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2026-10-28 16:11:32 +01:00 • committed by Nicolas De loof
parent 70ec1e62f6
commit 343bb382d2
4 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@
ARG GO_VERSION=1.26.10
ARG XX_VERSION=1.9.0
ARG GOLANGCI_LINT_VERSION=v2.13.2
ARG GOLANGCI_LINT_VERSION=v2.15.0
ARG ADDLICENSE_VERSION=v1.0.0
# Keep in sync with GOTESTSUM_VERSION in the Makefile
ARG GOTESTSUM_VERSION=v1.13.0

View file

@ -122,7 +122,7 @@ func (s *composeService) runHook(ctx context.Context, ctr container.Summary, ser
// Close the connection to unblock the blocked Read in the copy goroutine,
// then wait for it to exit before returning so there is no goroutine leak.
attach.Close()
<-copyDone
<-copyDone //nolint:errcheck // the copy error is irrelevant: the context error is returned
return ctx.Err()
}

View file

@ -208,7 +208,7 @@ func (s *composeService) execPreStartHook(
// Drain waitRes so the client's wait goroutine exits without having to
// wait for the parent context to be canceled.
select {
case <-waitRes.Error:
case <-waitRes.Error: //nolint:errcheck // only draining: the error that matters is the one being returned
case <-waitRes.Result:
case <-ctx.Done():
}

View file

@ -289,7 +289,7 @@ func (h *interactiveUpHarness) upWith(t *testing.T, ctx context.Context, cancel
case <-time.After(10 * time.Second):
cancel()
select {
case <-done:
case <-done: //nolint:errcheck // only waiting for up to return, the test fails right below
case <-time.After(5 * time.Second):
}
t.Fatalf("up did not return; calls so far: %v", h.daemon.recorded())