SkyAPM / go2sky

Distributed tracing and monitor SDK in Go for Apache SkyWalking APM
https://skywalking.apache.org/
Apache License 2.0
448 stars 122 forks source link

fix(tracer): fixed create exit span with context error when current context not to be sampled #135

Closed Luckyboys closed 2 years ago

Luckyboys commented 2 years ago

In the tracer CreateExitSpanWithContext function, when the context is not a sample in this time, it will be return a "span type is wrong" error.

Because trying to check the span is NoopSpan when after called CreateLocalSpan function, the convertion is expected a struct value.

But actual, the CreateLocalSpan function return a Span is a interface type, a interface type is a pointer in golang.

So we need to change the convertion to expect a pointer of NoopSpan type.

fix #113

Luckyboys commented 2 years ago

@arugal Please review this fix, thank you