chore: bump errors to v0.2.13, apply go fix#34
Conversation
- Bump errors v0.2.12 → v0.2.13 (validateTraceID fast-path)
- go fix: interface{} → any, add slices import
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 21 minutes and 19 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, 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 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. 📝 WalkthroughWalkthroughThis PR modernizes the codebase to use Go 1.18+ Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Pull request overview
This PR updates the interceptors module by bumping github.com/go-coldbrew/errors and applying go fix-style modernization to the codebase (notably switching interface{} to any and using slices.Contains).
Changes:
- Bump
github.com/go-coldbrew/errorsfromv0.2.12tov0.2.13. - Modernize Go code by replacing
interface{}withanyacross interceptors and tests. - Simplify excluded gRPC code checks using
slices.Containsin the Hystrix client interceptor.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| interceptors.go | Modernizes public/internal interceptor signatures to any; uses slices.Contains for excluded code checks. |
| interceptors_test.go | Updates tests to match any-typed signatures and related modernizations. |
| go.mod | Bumps github.com/go-coldbrew/errors requirement to v0.2.13. |
| go.sum | Updates module sums for the errors dependency bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
interceptors.go (1)
323-345: Update theDoHTTPtoGRPCdoc example toanyfor consistency.The example still shows
interface{}(Line 331–332) while the function now usesany(Line 344). Aligning the comment avoids API drift in docs.✏️ Suggested doc-only diff
-// handler := func(ctx context.Context, req interface{}) (interface{}, error) { +// handler := func(ctx context.Context, req any) (any, error) { // return s.echo(ctx, req.(*proto.EchoRequest)) // }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@interceptors.go` around lines 323 - 345, The doc example in the DoHTTPtoGRPC comment still uses interface{}; update all occurrences to use the newer any alias for consistency with the DoHTTPtoGRPC signature — specifically change the handler signature and the type assertions/returns in the Echo and echo examples (references: DoHTTPtoGRPC, handler, Echo, echo) so the example reads handler func(ctx context.Context, req any) (any, error) and casts to/from any instead of interface{}.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@interceptors.go`:
- Around line 323-345: The doc example in the DoHTTPtoGRPC comment still uses
interface{}; update all occurrences to use the newer any alias for consistency
with the DoHTTPtoGRPC signature — specifically change the handler signature and
the type assertions/returns in the Echo and echo examples (references:
DoHTTPtoGRPC, handler, Echo, echo) so the example reads handler func(ctx
context.Context, req any) (any, error) and casts to/from any instead of
interface{}.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3b67c4e6-7163-4607-a9ad-055c2707910e
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (3)
go.modinterceptors.gointerceptors_test.go
Summary
go fixmodernization:interface{}→any, addslicesimportTest plan
go test -race ./...passesSummary by CodeRabbit
Chores
Refactor
Tests