Skip to content

Commit df3170c

Browse files
committed
fix(storage): drop ineffectual keyHash initial assignment
ineffassign caught `keyHash := base` in FileIDFromPath being unconditionally overwritten by the suffix-strip switch (or overridden by the default branch's early return). Switching to `var keyHash string` makes the intent explicit: the switch assigns in every path that doesn't return. Pure cleanup. Pre-pushed through the same golangci-lint v2.0.2 binary CI uses; full repo now reports '0 issues'.
1 parent 0a91e41 commit df3170c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎internal/storage/canonical.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func FileIDFromPath(dataDir, path string) (FileID, error) {
161161
return FileID{}, fmt.Errorf("FileIDFromPath: date segment %q does not match YYYY-MM-DD", date)
162162
}
163163
// Strip the suffix. Order matters: .jsonl.gz first, then .jsonl.
164-
keyHash := base
164+
var keyHash string
165165
switch {
166166
case len(base) > len(".jsonl.gz") && base[len(base)-len(".jsonl.gz"):] == ".jsonl.gz":
167167
keyHash = base[:len(base)-len(".jsonl.gz")]

0 commit comments

Comments
 (0)