Repository navigation
test(drive): remove dead countingBlockFetcher helper - #16
Merged
Merged
Conversation
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)
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.
Summary
countingBlockFetcherinapi/drive/blockstore_internal_test.gois dead code.It is instantiated in
TestBlockStoreCacheMissFetchPopulatesand immediatelydiscarded with
_ = fetcher, and itsfetchmethod is never called fromanywhere. 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: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
fetchmethod, the discardedfetchervariable, and thestale comment referencing it. The
ioimport is retained — it is still usedelsewhere in the file.
Testing
Verified against golangci-lint 2.13.2 and the Go 1.26.8 toolchain, each step
logged in full:
go build ./...go vet ./...go test ./...golangci-lint run --config .golangci.ymlA full-module lint of
mainreports exactly this one issue and nothing else, sothis brings the whole module clean.
Scope
Two related things are deliberately not addressed here:
httpBlockStoreit discards the same way(
_ = store), and its doc comment claims to verify that a cache miss fetchesover 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.
golangci-linthook compares againstHEADrather than the pull requestbase, so it reports pre-existing findings anywhere in the module regardless of
what the PR touched. That is a separate CI fix.