Conversation
Doesn't seem to crash the tests but the old code made me nervous so here we are. Signed-off-by: Amy Tobey <atobey@equinix.com>
|
I think Go maps return the empty value on missing key. I still like that this explicitly says "this function will return empty string if there is no traceparent". |
Signed-off-by: Amy Tobey <atobey@equinix.com>
|
Don't mind me arguing with myself. I think I'm right about this and feel compelled to explain:
The change I'm making here is to make it explicit that this function's behavior is to return empty string. It is not a side-effect of map behavior. The correct logic is "we looked and there was no traceparent, you can tell because we gave you back an empty string" not "just do whatever map does". |
|
Also it occurs to me that in some situations we can end up with the all-zeroes traceparent string here. I think the propagator stuff avoids that but need to validate what it does when non-recording. |
|
(all zeroes is fine I think, I'm just fussy about consistent and/or documented behavior in libs like this) |
Doesn't seem to crash the tests but the old code made me nervous so here we are.