Skip to content

[AI:zf-builder] refactor(server): remove dead error return from logger.InitLogger - #158

Merged
ntsd merged 2 commits into
mainfrom
task/zf-z-eb832c95
Nov 19, 2026
Merged

ntsd merged 2 commits into
mainfrom
task/zf-z-eb832c95

Conversation

@ntsd

@ntsd ntsd commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

[AI:zf-builder] Task: zf-z-eb832c95

refactor(server): remove dead error return from logger.InitLogger (Ponytail Rung 1)

Automated PR for task zf-z-eb832c95

Completed by: @zf-builder

ntsd added 2 commits November 20, 2026 02:33
Task: zf-z-eb832c95

refactor(server): remove dead error return from logger.InitLogger (Ponytail Rung 1)
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying zerohub with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8b7796e
Status: ✅  Deploy successful!
Preview URL: https://3856f57f.zerohub.pages.dev
Branch Preview URL: https://task-zf-z-eb832c95.zerohub.pages.dev

View logs

@ntsd ntsd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[AI:zf-reviewer] [Reviewer Feedback] Round 1: Approved for human review.

Ponytail Gatekeeping

Rung 7 (Diff Scope): Exactly 2 files, 2 insertions / 6 deletions. No drive-by churn, no reformatting, no leftover artifacts. Clean.

Rungs 3 & 5 (Dependencies): No new dependencies. No go.mod / package.json changes.

Rungs 1 & 6 (Simplicity / YAGNI): The PR is the simplification. InitLogger always returned nil — none of the three zerolog setters can fail — so the error return type and the if err := guard at the single call site were pure dead code. Removing both is the flat, correct fix.

Correctness

  • server/pkg/logger/logger.go: signature changed to func InitLogger(cfg *config.Config), return nil removed. Body unchanged.
  • server/cmd/server.go:23: logger.InitLogger(cfg) called bare. fmt import still needed (used at lines 20, 31, 35, 44) — no unused-import issue.
  • Grep confirms no other call site references the removed error return.

Automated Gates

Gate Result
go build ./... PASS
go vet ./... PASS
go test ./... PASS (all packages)
Mergeable vs main CLEAN

Test Coverage

This is a pure signature simplification with no behavioral change. The existing handler/hub/peer/zerohub test suites exercise the full server startup path and all pass. The logger package had no test files before and still has none — consistent with a trivial one-liner that cannot fail.

CONVENTION: When removing a vestigial error return in Go, verify the import block still needs every remaining import (here fmt is still used 4 more times in the same file) to avoid an unused-import build failure.

@ntsd
ntsd merged commit c51d2c3 into main Nov 19, 2026
3 checks passed
@ntsd
ntsd deleted the task/zf-z-eb832c95 branch November 19, 2026 19:40
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.

1 participant