From 7c932dad565600f98cdb05e57f7043735c41f560 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Wed, 26 Sep 2018 18:18:08 +0200 Subject: [PATCH] fix(zap): porting to uint64 IDs --- zap/tracer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zap/tracer.go b/zap/tracer.go index 30ada5b744..d702982742 100644 --- a/zap/tracer.go +++ b/zap/tracer.go @@ -49,7 +49,7 @@ func (t *Tracer) StartSpan(operationName string, opts ...opentracing.StartSpanOp break } } - if len(ctx.traceID) == 0 { + if !ctx.traceID.Valid() { ctx.traceID = t.IDGenerator.ID() } return &Span{ @@ -115,10 +115,10 @@ func (t *Tracer) Extract(format interface{}, carrier interface{}) (opentracing.S default: return nil, fmt.Errorf("unsupported format %v", format) } - if len(ctx.traceID) == 0 { + if !ctx.traceID.Valid() { ctx.traceID = t.IDGenerator.ID() } - if len(ctx.spanID) == 0 { + if !ctx.spanID.Valid() { return nil, errors.New("no span ID found in carrier") } return ctx, err