Skip to content

release-notes: check errors flagged by errcheck - #380

Merged
prestist merged 1 commit into
coreos:mainfrom
prestist:release-notes-errcheck
Oct 28, 2026
Merged

prestist merged 1 commit into
coreos:mainfrom
prestist:release-notes-errcheck

Conversation

@prestist

Copy link
Copy Markdown
Contributor

Ignition's Test jobs run golangci-lint with the default linter set, which includes errcheck. The release-notes tool synced by #379 (arriving downstream as coreos/ignition#2352) fails lint with seven unchecked error returns:

  • two fmt.Fprintf calls to stdout
  • defer file.Close() in readFileSnapshot
  • defer os.Remove in finalizeWithOps and atomicReplace
  • temporary.Close/os.Remove in writeTemporaryFile's deferred cleanup

This explicitly discards those errors, matching the conventions already used elsewhere in Ignition (_, _ = fmt.Fprintf in internal/main.go, defer func() { _ = ... }() in internal/exec, _ = os.Remove in internal/exec/util). None of these errors have a useful handling path: they are best-effort output writes and best-effort cleanup of temporary files.

Verified by rendering the template and running golangci-lint run (v2.11.3, matching CI) and go test against the rendered output inside the Ignition module: 0 issues, tests pass.

Merging this will update the open coreos/ignition#2352 sync branch automatically via sync.yml, turning its Test (1.25.x)/Test (1.26.x) jobs green.

Assisted-by: AI tooling

Ignition's golangci-lint configuration enables errcheck, so the
synced tool fails lint downstream. Explicitly discard errors that
have no useful handling, matching Ignition's existing conventions.
Verified by running golangci-lint 2.11.3 and go test against the
rendered output inside the Ignition module.

Assisted-by: AI tooling
@prestist
prestist enabled auto-merge October 28, 2026 15:28

@angelcerveraroldan angelcerveraroldan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@prestist
prestist merged commit f88f13f into coreos:main Oct 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants