Clean up redundant imports, deprecated calls, and dead code#13
Merged
PeterRounce merged 1 commit intomainfrom Feb 21, 2026
Merged
Clean up redundant imports, deprecated calls, and dead code#13PeterRounce merged 1 commit intomainfrom
PeterRounce merged 1 commit intomainfrom
Conversation
- 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>
There was a problem hiding this comment.
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-sqlite3blank import to a single location (db/db_init.go) and remove redundant imports across the project. - Replace deprecated
log.Warning(...)calls withlog.Warn(...). - Fix static
.jsserving Content-Type and remove dead/commented debug code; replaceutil.Maxusage with Go’s builtinmaxand 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.
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
go-sqlite3driver imports from 13 files (only needed once indb_init.go)log.Warning→log.Warn(5 call sites in phoenix and websocket packages)application/jsontoapplication/javascriptin static file servingutil.Maxwith Go builtinmax, delete the now-unused functionTest plan
go vet ./...passesgo test -race -count=1 ./...passes (crypto, db, web)🤖 Generated with Claude Code