SpanFromContext returns the `Span` previously associated with `ctx`, or `nil` if no such `Span` could be found.
(ctx context.Context)
| 255 | // SpanFromContext returns the `Span` previously associated with `ctx`, or |
| 256 | // `nil` if no such `Span` could be found. |
| 257 | func SpanFromContext(ctx context.Context) Span { |
| 258 | span := opentracing.SpanFromContext(ctx) |
| 259 | s, ok := span.(Span) |
| 260 | if !ok { |
| 261 | return nil |
| 262 | } |
| 263 | return s |
| 264 | } |
| 265 | |
| 266 | // SpanFromContextSafe returns the `Span` previously associated with `ctx`, or |
| 267 | // creates a root Span with name default. |
no outgoing calls