lint: resolve all errcheck findings #582

Open
opened 2026-09-22 17:10:33 +00:00 by hexajon · 0 comments
Owner

Context

errcheck reports 50 findings in non-test code. The convention is to never
silence an error without cause. Use a blank assignment only for a call that
cannot fail or that is deliberately best-effort, and make the reason obvious
from the surrounding code.

What

Fix every errcheck finding. Handle these patterns:

  • defer x.Close() and cleanup calls (response body close, file close,
    os.Remove, server close): blank-assign or log and continue.
  • fmt.Fprint, fmt.Fprintf, fmt.Fprintln to fixed writers (CLI and status
    output).
  • cmd.MarkFlagRequired(...) in command wiring: infallible, blank-assign.
  • json.Unmarshal on internally produced envelopes in internal/cmd/issue/get.go:
    check the error.
  • git and orchestrate calls in the bisect, pipeline, and revert paths: decide
    per site, either propagate the error or ignore it deliberately with a
    comment.

Files touched: internal/cmd/{actions/artifacts, file/file, install/install, issue/get, orglabels/orglabels, root, setup/prompt, tagapi/tagapi}.go,
internal/format/{list,output}.go, internal/gitea/{client_activitypub, client_http, client_pr}.go, internal/parity/{readme_command_drift, stale_command_ref_drift}.go, internal/safeio/atomic.go,
internal/service/{git/clone, issueimport/checkpoint, orchestrate/*, workflow/finish_classify}.go.

Acceptance

  • golangci-lint reports zero errcheck findings.
  • go test ./... stays green, with no behavior change on any exercised path.
## Context errcheck reports 50 findings in non-test code. The convention is to never silence an error without cause. Use a blank assignment only for a call that cannot fail or that is deliberately best-effort, and make the reason obvious from the surrounding code. ## What Fix every errcheck finding. Handle these patterns: - `defer x.Close()` and cleanup calls (response body close, file close, os.Remove, server close): blank-assign or log and continue. - `fmt.Fprint`, `fmt.Fprintf`, `fmt.Fprintln` to fixed writers (CLI and status output). - `cmd.MarkFlagRequired(...)` in command wiring: infallible, blank-assign. - `json.Unmarshal` on internally produced envelopes in `internal/cmd/issue/get.go`: check the error. - git and orchestrate calls in the bisect, pipeline, and revert paths: decide per site, either propagate the error or ignore it deliberately with a comment. Files touched: `internal/cmd/{actions/artifacts, file/file, install/install, issue/get, orglabels/orglabels, root, setup/prompt, tagapi/tagapi}.go`, `internal/format/{list,output}.go`, `internal/gitea/{client_activitypub, client_http, client_pr}.go`, `internal/parity/{readme_command_drift, stale_command_ref_drift}.go`, `internal/safeio/atomic.go`, `internal/service/{git/clone, issueimport/checkpoint, orchestrate/*, workflow/finish_classify}.go`. ## Acceptance - golangci-lint reports zero errcheck findings. - `go test ./...` stays green, with no behavior change on any exercised path.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#582
No description provided.