-
Notifications
You must be signed in to change notification settings - Fork 113
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
add ability to serialize/deserialize b3 to Go map[string]string #145
Conversation
propagation/b3/map_test.go
Outdated
func TestMapExtractTraceIDError(t *testing.T) { | ||
m := make(b3.Map) | ||
|
||
m[b3.TraceID] = "invalid_data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string invalid_data
has 4 occurrences, make it a constant (from goconst
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish this would be squelched for *_test packages
This also allows for keeping B3 logic separated from OpenTracing... a PR for our OpenTracing Go bridge will follow on that repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
|
||
if want, have := false, *sc.Sampled; want != have { | ||
t.Errorf("Sampled want %t, have %t", want, have) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment, I'm surprised that go doesn't include matchers in the standard library test utilities
This PR allows proper B3 serialization / deserialization logic on a generic Go map[string]string storage.
This allows for easy B3 plugability when dealing with non natively supported header containers.