Skip to content

chore: apply go fix improvements#84

Merged
echarrod merged 2 commits into
mainfrom
echarrod/go-fix-improvements
May 5, 2026
Merged

chore: apply go fix improvements#84
echarrod merged 2 commits into
mainfrom
echarrod/go-fix-improvements

Conversation

@echarrod
Copy link
Copy Markdown
Contributor

@echarrod echarrod commented Apr 13, 2026

Apply go fix to modernize the codebase:

  • Add missing imports
  • Optimize string concatenation using strings.Builder (performance improvement over concatenation loops)
  • Use Go 1.22 range-over-int syntax (for i := range N instead of for i := 0; i < N; i++)

Summary by CodeRabbit

This release includes extensive internal code modernisation across the codebase, improving consistency and maintainability.

  • Refactor

    • Standardised implementation patterns for consistency and clarity across modules
  • Tests

    • Simplified iteration constructs in test code
    • Enhanced concurrency handling in concurrent tests
    • Improved overall test readability and maintainability

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

Warning

Rate limit exceeded

@echarrod has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 30 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d21d08b-088a-4b59-80d6-bb621bb3bf88

📥 Commits

Reviewing files that changed from the base of the PR and between c2cbc03 and e05299f.

📒 Files selected for processing (1)
  • rsql/helpers_test.go
📝 Walkthrough

Walkthrough

This pull request modernises Go code patterns across 15+ files in the codebase. The changes include converting traditional for i := 0; i < n; i++ loops to for range n syntax, replacing interface{} type annotations with the any alias, updating concurrency patterns from manual Add(1)/Done() calls to wg.Go() methods, and refactoring MySQL error detection to use slices.Contains. These updates affect both test and production code, focusing on consistency with contemporary Go idioms and standard library improvements.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

AI::Created

Suggested reviewers

  • ScaleneZA
  • RieshBissessur
  • andrewwormald

Poem

🐰 Hop, hop—loops now range so free,
Ancient interface{} fades to memory,
any aliases dance, wg.Go() takes flight,
Modernised patterns, shining bright!
Go idioms gleam—the future is here.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.93% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: applying go fix improvements to modernise the codebase across multiple files.
Description check ✅ Passed The description clearly relates to the changeset, detailing the specific improvements applied: missing imports, strings.Builder optimisation, and Go 1.22 range-over-int syntax.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch echarrod/go-fix-improvements

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@echarrod echarrod enabled auto-merge (squash) April 13, 2026 08:33
- Add missing imports
- Optimize string concatenation using strings.Builder
- Use Go 1.22 range-over-int syntax
@echarrod echarrod force-pushed the echarrod/go-fix-improvements branch from efcd192 to c2cbc03 Compare May 5, 2026 10:46
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 `@rsql/helpers_test.go`:
- Around line 48-49: The helper assertEqualI2S forwards a variadic msgAndArgs
slice to testify's assert.Equal but doesn't expand it, so the messages are
passed as a single argument; update the call in assertEqualI2S to pass
msgAndArgs... (i.e., expand the variadic) when calling assert.Equal(t,
i2s(expected), actual, msgAndArgs...) so testify can interpret assertion
messages correctly.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3c88004-3e41-4780-bf1d-3f2303f4a0aa

📥 Commits

Reviewing files that changed from the base of the PR and between 5d0291c and c2cbc03.

📒 Files selected for processing (17)
  • internal/metrics/metrics_test.go
  • rblob/blob.go
  • rblob/blob_test.go
  • rpatterns/batch_test.go
  • rpatterns/concurrent.go
  • rpatterns/concurrent_test.go
  • rpatterns/cursor_test.go
  • rpatterns/deadletter_test.go
  • rpatterns/parallel.go
  • rpatterns/sequence.go
  • rsql/cursorstable.go
  • rsql/cursorstable_test.go
  • rsql/db.go
  • rsql/db_test.go
  • rsql/eventstable_test.go
  • rsql/helpers_test.go
  • rsql/stream_test.go

Comment thread rsql/helpers_test.go Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

@echarrod echarrod merged commit 8fe4946 into main May 5, 2026
5 checks passed
@echarrod echarrod deleted the echarrod/go-fix-improvements branch May 5, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants