Skip to content

Refactor codebase per Go patterns review#4

Merged
gali-leilei merged 3 commits intomainfrom
dev-ll-last-refactor
Mar 11, 2026
Merged

Refactor codebase per Go patterns review#4
gali-leilei merged 3 commits intomainfrom
dev-ll-last-refactor

Conversation

@gali-leilei
Copy link
Contributor

Summary

  • Deduplicate Run/RunWithDBRun now delegates to RunWithDB after creating the DB
  • Consolidate parseRanks/parseCSVInts — single function returning ([]int, error) instead of log.Fatalf
  • Named symbol.Entry type — replaces anonymous struct{ ID int; Name string } in Table.All()
  • Extract inClause helper — removes 8 copies of the IN-clause builder pattern in reader.go
  • InsertMetadata takes store.Metadata struct — replaces 8 positional parameters
  • Add store.Open for read paths — read-optimised DB open without WAL/synchronous pragmas
  • parseCSVInts returns error — utility functions no longer call log.Fatalf

Closes #3

Test plan

  • go vet ./... passes
  • go build ./... passes
  • go test ./... -short — all packages pass

🤖 Generated with Claude Code

gali-leilei and others added 3 commits March 11, 2026 15:46
Deduplicate Run/RunWithDB, consolidate parseRanks/parseCSVInts,
extract IN-clause helper, add symbol.Entry named type, accept
store.Metadata struct in InsertMetadata, add store.Open for
read-only paths, and return errors from parseCSVInts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gali-leilei gali-leilei merged commit 0b77f45 into main Mar 11, 2026
1 check passed
@gali-leilei gali-leilei deleted the dev-ll-last-refactor branch March 11, 2026 07:59
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.

Golang pattern review

1 participant