It is not obvious how that should be used. The = assignment suggests that "span" is already declared which means it should be used after the short assignment statement (:=) that already exists, like this:
I'm guessing this is not what is intended, and running the code it is clear a unique trace is still being created. I think that example should be updated to this:
The lesson text uses this code to show usage of ChildOf():
It is not obvious how that should be used. The
=
assignment suggests that "span" is already declared which means it should be used after the short assignment statement (:=
) that already exists, like this:I'm guessing this is not what is intended, and running the code it is clear a unique trace is still being created. I think that example should be updated to this:
That is, use
:=
assignment and replacespan.Context()
withrootSpan.Context()
.