Repository navigation
[AI:zf-builder] refactor(server): remove dead error return from logger.InitLogger - #158
Conversation
Task: zf-z-eb832c95 refactor(server): remove dead error return from logger.InitLogger (Ponytail Rung 1)
Deploying zerohub with
|
| Latest commit: |
8b7796e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3856f57f.zerohub.pages.dev |
| Branch Preview URL: | https://task-zf-z-eb832c95.zerohub.pages.dev |
ntsd
left a comment
There was a problem hiding this comment.
[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 tofunc InitLogger(cfg *config.Config),return nilremoved. Body unchanged.server/cmd/server.go:23:logger.InitLogger(cfg)called bare.fmtimport 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.
[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