fix: inline tint.NewHandler calls to satisfy govet linter#862
Merged
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesLogger setup
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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.
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:
Summary by CodeRabbit