You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-12-01 23:12:29 +02:00
add IsValid() for SpanContext (#46)
* add IsValid() for SpanContext * add unit test
This commit is contained in:
@@ -44,6 +44,10 @@ var (
|
||||
INVALID_SPAN_CONTEXT = SpanContext{}
|
||||
)
|
||||
|
||||
func (sc SpanContext) IsValid() bool {
|
||||
return sc.HasTraceID() && sc.HasSpanID()
|
||||
}
|
||||
|
||||
func (sc SpanContext) HasTraceID() bool {
|
||||
return sc.TraceID.High != 0 || sc.TraceID.Low != 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user