feat: add customize tracer in extract func and add gomodule#4
Open
codjust wants to merge 1 commit intoopentracing-contrib:masterfrom
Open
feat: add customize tracer in extract func and add gomodule#4codjust wants to merge 1 commit intoopentracing-contrib:masterfrom
codjust wants to merge 1 commit intoopentracing-contrib:masterfrom
Conversation
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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