Migrate to golangci-lint, replace retired Go Report Card badge - #26
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,standardlinters. errcheck excludes thefmt.Fprint*family (unactionable stdout/stderr writes)..github/workflows/lint.yml— runs golangci-lint (pinnedv2.12.2) on push tomainand all PRs.Lint fixes —
golangci-lint runwent from 57 findings (56 errcheck + 1 staticcheck) to 0:upload.go— the two multipartwriter.Close()calls now check their error, matching the existing pattern ins3.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).Close()calls wrapped to discard the error explicitly.upload_test.go—Write([]byte(fmt.Sprintf(...)))→fmt.Fprintf(staticcheck QF1012).fmt.Fprint*writes to stdout/stderr inmain.goare 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 →
Lintworkflow status badge.Validation
golangci-lint run→ 0 issuesgo vet ./...,gofmt -l .→ cleango test -race -cover ./...→ all pass (~88–93% coverage)