Skip to content

Migrate to golangci-lint, replace retired Go Report Card badge - #26

Merged
drogers0 merged 1 commit into
mainfrom
fix/25-golangci-lint-migration
Jul 6, 2026
Merged

Migrate to golangci-lint, replace retired Go Report Card badge#26
drogers0 merged 1 commit into
mainfrom
fix/25-golangci-lint-migration

Conversation

@drogers0

@drogers0 drogers0 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Closes #25.

Go Report Card has been sunset; its badge endpoint now literally renders go report | retired, making the README look broken. This migrates the repo to golangci-lint and replaces the dead pill with a Lint workflow status badge.

What changed

CI / config (new)

  • .golangci.yml — v2 schema, standard linters. errcheck excludes the fmt.Fprint* family (unactionable stdout/stderr writes).
  • .github/workflows/lint.yml — runs golangci-lint (pinned v2.12.2) on push to main and all PRs.

Lint fixesgolangci-lint run went from 57 findings (56 errcheck + 1 staticcheck) to 0:

  • upload.go — the two multipart writer.Close() calls now check their error, matching the existing pattern in s3.go. This is the only behavior change: on a Close error they now return early instead of sending a malformed body (the buffer-backed Close never errors in practice).
  • Deferred response-body/file Close() calls wrapped to discard the error explicitly.
  • upload_test.goWrite([]byte(fmt.Sprintf(...)))fmt.Fprintf (staticcheck QF1012).
  • ~48 fmt.Fprint* writes to stdout/stderr in main.go are excluded via config rather than edited — a failed write there isn't actionable and editing each would be pure noise.

README — retired Go Report Card badge → Lint workflow status badge.

Validation

  • golangci-lint run0 issues
  • go vet ./..., gofmt -l . → clean
  • go test -race -cover ./... → all pass (~88–93% coverage)

Go Report Card has been sunset; its badge now renders "retired". Adopt
golangci-lint as the code-quality check and surface a Lint workflow
status badge instead.

- Add .golangci.yml (v2, standard linters) and .github/workflows/lint.yml
  (golangci-lint pinned to v2.12.2, on push/PR).
- Fix all lint findings so `golangci-lint run` reports 0 issues:
  - Check the two multipart writer.Close() calls in upload.go, matching
    the existing pattern in s3.go.
  - Wrap deferred response-body/file Close() calls to discard errors
    explicitly.
  - Rewrite Write([]byte(fmt.Sprintf(...))) as fmt.Fprintf in a test
    (staticcheck QF1012).
  - Exclude fmt.Fprint* (stdout/stderr writes) via errcheck config; a
    failed write there is not actionable.
- README: replace the retired Go Report Card pill with the Lint badge.
@drogers0
drogers0 merged commit 764502b into main Jul 6, 2026
2 checks passed
@drogers0
drogers0 deleted the fix/25-golangci-lint-migration branch July 6, 2026 18:10
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.

go report retired

1 participant