Remove redundant variable in TestNewMockParams_DisablesStats#143
Conversation
Co-authored-by: yegor256 <526301+yegor256@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes an intermediate variable assignment in TestNewMockParams_DisablesStats by inlining the NewMockParams() call directly in the assertion. While the change reduces verbosity by eliminating a single-use variable, it introduces an inconsistency with the established pattern used throughout the test file.
Key Changes:
- Inline
NewMockParams()call directly in assertion instead of storing in intermediate variable
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func TestNewMockParams_DisablesStats(t *testing.T) { | ||
| params := NewMockParams() | ||
| assert.False(t, params.Stats, "stats must be disabled") | ||
| assert.False(t, NewMockParams().Stats, "stats must be disabled") |
There was a problem hiding this comment.
This inline style is inconsistent with all other test functions in this file (lines 11-94), which store the result of NewMockParams() in a params variable before making assertions. For consistency and maintainability, consider either keeping the original two-line pattern or updating all similar test functions to use the inline style.
| assert.False(t, NewMockParams().Stats, "stats must be disabled") | |
| params := NewMockParams() | |
| assert.False(t, params.Stats, "stats must be disabled") |
Eliminates intermediate variable assignment where the value is used exactly once, per feedback on #139.
Changes:
NewMockParams()call directly in assertion instead of storing inparamsvariableBefore:
After:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.