chore: simplify, modernize (Go 1.26), update deps#81
Conversation
- rpc.go: drop misleading `stderr` alias for `errors` (no import conflict) - rpc.go: replace manual key-collect loop with `slices.Collect(maps.Keys(...))` - plugin.go: use two-value type assertion in Collects callback; log+skip on mismatch instead of panic
|
Warning Review limit reached
More reviews will be available in 33 minutes and 58 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #81 +/- ##
==========================================
- Coverage 84.61% 83.33% -1.29%
==========================================
Files 2 2
Lines 26 24 -2
==========================================
- Hits 22 20 -2
Misses 2 2
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR modernizes the resetter service implementation by adopting newer Go stdlib helpers for map key collection and by hardening plugin collection to avoid panics when unexpected types are encountered.
Changes:
rpc.go: simplify error creation/imports and usemaps.Keys+slices.Collectto build the plugin list.plugin.go: replace a potentially panicking type assertion with a safe assertion that logs and skips non-Resettervalues.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| rpc.go | Simplifies imports/error aliasing and uses modern stdlib helpers to collect plugin names. |
| plugin.go | Prevents panics during dependency collection by safely asserting Resetter and warning on mismatch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Changes applied
S (simplify) — 2 applied:
rpc.go: dropped misleadingstderr "errors"alias; no import conflict existsrpc.go: replaced manualmake+appendkey-collect loop withslices.Collect(maps.Keys(...))M (modern Go) — 1 applied (same location as S above):
rpc.go:maps.Keys(Go 1.23 stdlib, available in this module's go 1.26)R (review/correctness) — 1 applied:
plugin.go:33: changed barepl.(Resetter)to two-value assertion; logs a warning and skips on mismatch instead of panicking if the framework ever passes a non-ResetterDeps
go get -u all && go mod tidyin root andtests/;go work syncat root. No version changes resulted (deps were already current).