Skip to content

Clean up redundant imports, deprecated calls, and dead code#13

Merged
PeterRounce merged 1 commit intomainfrom
refactor-phoenix-client-and-fixes
Feb 21, 2026
Merged

Clean up redundant imports, deprecated calls, and dead code#13
PeterRounce merged 1 commit intomainfrom
refactor-phoenix-client-and-fixes

Conversation

@PeterRounce
Copy link
Member

Summary

  • Remove redundant go-sqlite3 driver imports from 13 files (only needed once in db_init.go)
  • Fix deprecated log.Warninglog.Warn (5 call sites in phoenix and websocket packages)
  • Fix JS Content-Type from application/json to application/javascript in static file serving
  • Replace custom util.Max with Go builtin max, delete the now-unused function
  • Remove commented-out debug logging code (4 blocks)

Test plan

  • go vet ./... passes
  • go test -race -count=1 ./... passes (crypto, db, web)
  • Verify static JS files served with correct Content-Type in browser dev tools

🤖 Generated with Claude Code

- Remove redundant go-sqlite3 driver imports from 13 files (kept in db_init.go)
- Fix deprecated log.Warning → log.Warn (5 call sites)
- Fix JS Content-Type from application/json to application/javascript
- Replace custom util.Max with Go builtin max
- Remove commented-out debug logging code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 21, 2026 21:29
@PeterRounce PeterRounce merged commit ca25a33 into main Feb 21, 2026
6 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes redundant/unused code and modernizes a few call sites across the Go services (db/web/phoenix), including logging cleanup and correct JS static asset Content-Type handling.

Changes:

  • Consolidate the go-sqlite3 blank import to a single location (db/db_init.go) and remove redundant imports across the project.
  • Replace deprecated log.Warning(...) calls with log.Warn(...).
  • Fix static .js serving Content-Type and remove dead/commented debug code; replace util.Max usage with Go’s builtin max and delete the now-unused helper.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docker/card/web/websocket.go Switch log.Warning to log.Warn on websocket write errors.
docker/card/web/wallet_api_payinvoice.go Remove unused util import and use builtin max instead of util.Max.
docker/card/web/render.go Remove commented debug log; serve .js with application/javascript.
docker/card/web/public_handler.go Remove commented debug logging.
docker/card/web/pos_api_addinvoice.go Remove commented-out auth token debug block.
docker/card/web/admin_handler.go Remove commented debug logging.
docker/card/util/utils.go Delete now-unused Max helper.
docker/card/phoenix/send_lightning_payment.go Replace log.Warning with log.Warn at several error/diagnostic sites.
docker/card/phoenix/client.go Replace log.Warning with log.Warn for non-200 responses.
docker/card/main.go Remove redundant sqlite3 driver blank import (driver now registered via db package).
docker/card/db/db_wipe.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_update.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_test_data.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_test.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_set.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_select.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_insert.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_get.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_create.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_close.go Remove redundant sqlite3 driver blank import.
docker/card/db/db_add.go Remove redundant sqlite3 driver blank import.
docker/card/cli.go Remove redundant sqlite3 driver blank import.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants