Skip to content

fix: inline tint.NewHandler calls to satisfy govet linter#862

Merged
tavdog merged 4 commits into
mainfrom
fix/inline-tint-handler
Jul 18, 2026
Merged

fix: inline tint.NewHandler calls to satisfy govet linter#862
tavdog merged 4 commits into
mainfrom
fix/inline-tint-handler

Conversation

@tavdog

@tavdog tavdog commented Jul 18, 2026

Copy link
Copy Markdown
Member

Assign tint.NewHandler result to a variable before passing to slog.New() on line 61 to allow govet to properly inline the call. This resolves the 'inline: Call of tint.NewHandler should be inlined' linting errors.

Fixes golangci-lint errors on:

  • cmd/server/cmd.go:61:27
  • cmd/server/cmd.go:98:16

Summary by CodeRabbit

  • Refactor
    • Streamlined the app’s logging initialization by reorganizing how the default logger and handlers are created and configured.
    • Kept non-JSON log output behavior the same, while improving maintainability of the text-based logging setup.

Assign tint.NewHandler result to a variable before passing to slog.New()
on line 61 to allow govet to properly inline the call. This resolves the
'inline: Call of tint.NewHandler should be inlined' linting errors.

Fixes golangci-lint errors on:
- cmd/server/cmd.go:61:27
- cmd/server/cmd.go:98:16
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b838648c-fcf5-48a2-bb02-46036b35b7b9

📥 Commits

Reviewing files that changed from the base of the PR and between de7f90d and 251c5b7.

📒 Files selected for processing (1)
  • cmd/server/cmd.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/server/cmd.go

📝 Walkthrough

Walkthrough

preRun stores the initial tint handler locally and uses tint.NewTextHandler when configuring non-JSON logging. Command wiring remains unchanged.

Changes

Logger setup

Layer / File(s) Summary
Tint handler initialization
cmd/server/cmd.go
preRun stores the initial tint handler in a local variable and switches non-JSON logging to tint.NewTextHandler; command wiring remains unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions inlining tint.NewHandler calls, but the change actually assigns handlers to variables and switches one call to NewTextHandler. Rename the PR to reflect the actual linter fix, e.g. "fix: adjust tint handler setup to satisfy govet".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/inline-tint-handler

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/server/cmd.go`:
- Around line 61-62: Replace the deprecated tint.NewHandler constructor with
tint.NewTextHandler at both logger setup sites in cmd/server/cmd.go, preserving
the existing stderr destination and opts arguments and leaving the slog default
setup unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7c889d21-b71d-48c6-bdd9-e51f6b3e8e2d

📥 Commits

Reviewing files that changed from the base of the PR and between 702d5b0 and 768f101.

📒 Files selected for processing (1)
  • cmd/server/cmd.go

Comment thread cmd/server/cmd.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/server/cmd.go`:
- Line 61: Remove the unused //nolint:govet directives from both
tint.NewTextHandler call sites in cmd/server/cmd.go, preserving the constructor
calls unchanged. Run golangci-lint on the Go code to verify the lint failure is
resolved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 519ac1e4-f824-49ad-95c7-4fa71b2b52f8

📥 Commits

Reviewing files that changed from the base of the PR and between 768f101 and de7f90d.

📒 Files selected for processing (1)
  • cmd/server/cmd.go

Comment thread cmd/server/cmd.go Outdated
@tavdog
tavdog merged commit 767e0bd into main Jul 18, 2026
11 checks passed
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