Skip to content

test(drive): remove dead countingBlockFetcher helper - #16

Merged
major0 merged 2 commits into
mainfrom
test/drive-remove-dead-block-fetcher
Sep 23, 2026
Merged

major0 merged 2 commits into
mainfrom
test/drive-remove-dead-block-fetcher

Conversation

@major0

@major0 major0 commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

countingBlockFetcher in api/drive/blockstore_internal_test.go is dead code.
It is instantiated in TestBlockStoreCacheMissFetchPopulates and immediately
discarded with _ = fetcher, and its fetch method is never called from
anywhere. The accompanying comment recorded that a real HTTP mock was not
feasible in-package, so the type existed only as commentary.

golangci-lint 2.13.2 reports it via unparam:

api/drive/blockstore_internal_test.go:240:56: (*countingBlockFetcher).fetch - result 1 (error) is always nil (unparam)

That diagnosis is correct rather than a false positive. No interface constrains
the signature, because nothing calls the method, so the error result is provably
always nil. Older golangci-lint releases did not flag it, which is why it went
unnoticed until now.

Changes

Remove the type, its fetch method, the discarded fetcher variable, and the
stale comment referencing it. The io import is retained — it is still used
elsewhere in the file.

Testing

Verified against golangci-lint 2.13.2 and the Go 1.26.8 toolchain, each step
logged in full:

Step Result
go build ./... pass
go vet ./... pass
go test ./... pass
golangci-lint run --config .golangci.yml 0 issues (was 1)

A full-module lint of main reports exactly this one issue and nothing else, so
this brings the whole module clean.

Scope

Two related things are deliberately not addressed here:

  • The test still builds an httpBlockStore it discards the same way
    (_ = store), and its doc comment claims to verify that a cache miss fetches
    over HTTP and populates the disk cache when it only round-trips the buffer
    cache. Making the test match its name is a behavioural change to test
    coverage and belongs in its own PR.
  • This is not what unblocks fix(lumo): use the 2.0 chat/completions generation endpoint #12 and feat(lumo): add a --web-search flag to serve #13. Those fail because the pre-commit
    golangci-lint hook compares against HEAD rather than the pull request
    base, so it reports pre-existing findings anywhere in the module regardless of
    what the PR touched. That is a separate CI fix.

countingBlockFetcher was instantiated in TestBlockStoreCacheMissFetchPopulates
and immediately discarded with `_ = fetcher`. Its fetch method was never
called from anywhere, and the accompanying comment recorded that a real HTTP
mock was not feasible in-package, so the type existed only as commentary.

golangci-lint 2.13.2 reports it through unparam: because no interface
constrains the signature, the error result is provably always nil. Older
golangci-lint releases did not flag it, which is why it went unnoticed.

Removing the type, its method, and the discarded variable takes a
full-module lint from one issue to none.

The test still constructs an httpBlockStore it discards the same way, and
its doc comment claims to verify that a cache miss fetches over HTTP and
populates the disk cache when it only round-trips the buffer cache. That is
left alone here; correcting the test to match its name is a separate change.

Assisted-by: Kiro <noreply@kiro.dev> (1.0.116)
@major0
major0 merged commit ed52f75 into main Sep 23, 2026
9 of 10 checks passed
@major0
major0 deleted the test/drive-remove-dead-block-fetcher branch September 23, 2026 13:46
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