Skip to content

feat: add customize tracer in extract func and add gomodule #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codjust
Copy link

@codjust codjust commented Apr 14, 2020

two feature:
1、add go module support,can use git tag to control version.
2、add ExtractWithTracer func, support customize tracer object, not just use global tracer

@lucacome lucacome requested a review from Copilot March 14, 2025 02:09
Copy link

@Copilot 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 adds support for custom tracer extraction and Go module support.

  • Added a new function, ExtractWithTracer, that accepts a custom tracer rather than relying solely on the global tracer.
  • Modified import statements to support Go modules.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
amqptracer/tracer.go Added a custom ExtractWithTracer function and related comments.
amqptracer/tracer_test.go Added tests for the new ExtractWithTracer function.

if err != nil {
t.Fatal(err)
}
if ctx.(testSpanContext).FakeID != 42 {
Copy link
Preview

Copilot AI Mar 14, 2025

Choose a reason for hiding this comment

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

The type assertion on ctx may panic if the assertion fails. Consider using the comma-ok idiom (e.g., spanCtx, ok := ctx.(testSpanContext)) and failing the test with a clear message if the assertion does not succeed.

Suggested change
if ctx.(testSpanContext).FakeID != 42 {
spanCtx, ok := ctx.(testSpanContext)
if !ok {
t.Fatalf("Expected testSpanContext, got %T", ctx)
}
if spanCtx.FakeID != 42 {

Copilot uses AI. Check for mistakes.

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.

1 participant