Skip to content

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

Open
codjust wants to merge 1 commit into
opentracing-contrib:masterfrom
codjust:feature/add-extractwithtracer-and-gomodule
Open

feat: add customize tracer in extract func and add gomodule#4
codjust wants to merge 1 commit into
opentracing-contrib:masterfrom
codjust:feature/add-extractwithtracer-and-gomodule

Conversation

@codjust

@codjust codjust commented Apr 14, 2020

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown

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.

Comment thread amqptracer/tracer_test.go
if err != nil {
t.Fatal(err)
}
if ctx.(testSpanContext).FakeID != 42 {

Copilot AI Mar 14, 2025

Copy link

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.

2 participants