Skip to content

chore: fix staticcheck findings and enforce go fix in lint - #21

Merged
dennis-tra merged 7 commits into
mainfrom
chore/lint-cleanup
Nov 6, 2026
Merged

dennis-tra merged 7 commits into
mainfrom
chore/lint-cleanup

Conversation

@dennis-tra

Copy link
Copy Markdown
Contributor

What and why

Removes the left-over ignores from staticcheck.conf that #20 added so lint would pass, and fixes the findings in code. Behavior is unchanged.

  • SA1016: os.Kill removed from signal.Notify; SIGKILL cannot be caught.
  • SA4009: unused err parameter in the migration WalkDir callback is now _.
  • U1000: removed the unused Host.conf field and fmtMultihash.
  • SA1029: the scheduler ID context key is now a typed key. The HTTP header name is unchanged.
  • go fix changes (any, range, fmt.Appendf) applied with just format, in their own commit.
  • just lint now fails when go fix -diff prints changes. Before, it exited 0 either way.

SA1019 stays ignored in staticcheck.conf, with a comment. It covers deprecated aws-sdk-go v1 (pkg/firehose) and go-ipfs-util (pkg/util). The move to aws-sdk-go v2 is too large for this PR.

How I checked it

  • just ci passes (gofumpt, go fix, go vet, staticcheck 2026.2.2, build, test).
  • Confirmed just lint exits 1 when a go fix change is pending.
  • The repo has no tests for the touched packages (pkg/server, pkg/db, cmd/parsec). Only the build and static checks cover them.

Deploy

Nothing.

SIGKILL cannot be handled, so listing it in signal.Notify had no effect. Behavior is unchanged.
The callback overwrote err before reading it. Behavior is unchanged.
A plain string key can collide with keys from other packages. The header name and the stored value are unchanged.
Replaces interface{} with any, a counting loop with range over int, and fmt.Sprintf into []byte with fmt.Appendf. Produced by just format.
go fix -diff exits 0 even when it prints a diff, so lint never failed on it.
The other ignored checks are fixed in code. SA1019 stays because the aws-sdk-go v1 migration is a larger change.
@dennis-tra
dennis-tra merged commit db7308d into main Nov 6, 2026
4 checks passed
@dennis-tra
dennis-tra deleted the chore/lint-cleanup branch November 6, 2026 10:06
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.

1 participant