Skip to content

chore: bump errors to v0.2.13, apply go fix#34

Merged
ankurs merged 3 commits intomainfrom
chore/bump-errors-gofix
Apr 4, 2026
Merged

chore: bump errors to v0.2.13, apply go fix#34
ankurs merged 3 commits intomainfrom
chore/bump-errors-gofix

Conversation

@ankurs
Copy link
Copy Markdown
Member

@ankurs ankurs commented Apr 4, 2026

Summary

  • Bump errors v0.2.12 → v0.2.13 (validateTraceID fast-path)
  • Apply go fix modernization: interface{}any, add slices import

Test plan

  • go test -race ./... passes

Summary by CodeRabbit

  • Chores

    • Updated module dependencies to latest patch versions.
  • Refactor

    • Modernized function signatures to use Go 1.18+ type syntax throughout the codebase.
    • Simplified conditional logic using standard library utility functions.
  • Tests

    • Updated test patterns and refined callback signatures for consistency.

- Bump errors v0.2.12 → v0.2.13 (validateTraceID fast-path)
- go fix: interface{} → any, add slices import
Copilot AI review requested due to automatic review settings April 4, 2026 14:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 4, 2026

Warning

Rate limit exceeded

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

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 @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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 005cf52e-a1a3-4878-b254-b04f7f10c8cd

📥 Commits

Reviewing files that changed from the base of the PR and between ea24734 and 0e6d2a6.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

This PR modernizes the codebase to use Go 1.18+ any type alias throughout the interceptors package, replacing interface{} in function signatures and parameters. It also updates module dependencies and simplifies code patterns using standard library utilities.

Changes

Cohort / File(s) Summary
Dependency Updates
go.mod
Bumped github.com/go-coldbrew/errors to v0.2.13 and github.com/go-coldbrew/log to v0.3.1.
Type Modernization - Interceptors
interceptors.go
Replaced interface{} with any across all unary and stream interceptor function signatures (chainUnaryServer, chainUnaryClient, DebugLoggingInterceptor, ResponseTimeLoggingInterceptor, OptionsInterceptor, NewRelicInterceptor, ServerErrorInterceptor, PanicRecoveryInterceptor, GRPCClientInterceptor, HystrixClientInterceptor, TraceIdInterceptor, and others). Added slices import and replaced manual loop with slices.Contains() in HystrixClientInterceptor.
Type Modernization - Tests
interceptors_test.go
Updated test callback signatures and variables from interface{} to any. Refactored concurrent test loops to use for range syntax with wg.Go() instead of manual wg.Add() and go func() patterns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 \hop hop\ With any we go,
No more interface{} to slow our show!
Modern Go shines through the night,
Cleaner signatures, pure delight! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main changes: bumping the errors dependency to v0.2.13 and applying go fix modernizations (interface{} → any).

✏️ 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 chore/bump-errors-gofix

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/errors from v0.2.12 to v0.2.13.
  • Modernize Go code by replacing interface{} with any across interceptors and tests.
  • Simplify excluded gRPC code checks using slices.Contains in 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.

Comment thread interceptors.go
Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
interceptors.go (1)

323-345: Update the DoHTTPtoGRPC doc example to any for consistency.

The example still shows interface{} (Line 331–332) while the function now uses any (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

📥 Commits

Reviewing files that changed from the base of the PR and between c772bcc and ea24734.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • interceptors.go
  • interceptors_test.go

@ankurs ankurs merged commit 0a5b348 into main Apr 4, 2026
7 checks passed
@ankurs ankurs deleted the chore/bump-errors-gofix branch April 4, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants