diff --git a/api/core/span_context.go b/api/core/span_context.go index 60aa3e2c6b6..79a8af626c8 100644 --- a/api/core/span_context.go +++ b/api/core/span_context.go @@ -135,7 +135,7 @@ func decodeHex(h string, b []byte) error { return err } - copy(b[:], decoded) + copy(b, decoded) return nil } diff --git a/propagation/http_trace_context_propagator.go b/propagation/http_trace_context_propagator.go index 86014f7f31c..473e79c715c 100644 --- a/propagation/http_trace_context_propagator.go +++ b/propagation/http_trace_context_propagator.go @@ -126,7 +126,7 @@ func (hp HTTPTraceContextPropagator) extractSpanContext( if len(sections[2]) != 16 { return core.EmptySpanContext() } - sc.SpanID, err = core.SpanIDFromHex(sections[2][:]) + sc.SpanID, err = core.SpanIDFromHex(sections[2]) if err != nil { return core.EmptySpanContext() }