From c897c6c26ca7935d8b3327eee63c158c00cb06d7 Mon Sep 17 00:00:00 2001 From: Mitch Usher Date: Thu, 25 Aug 2022 14:55:47 -0600 Subject: [PATCH] Update sdk/trace/tracer.go Co-authored-by: Tyler Yahn --- sdk/trace/tracer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/trace/tracer.go b/sdk/trace/tracer.go index b0c0e6ef361..7b11fc465c6 100644 --- a/sdk/trace/tracer.go +++ b/sdk/trace/tracer.go @@ -37,8 +37,8 @@ var _ trace.Tracer = &tracer{} func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanStartOption) (context.Context, trace.Span) { config := trace.NewSpanStartConfig(options...) - // If ctx is nil, set to context.Background() as context.WithValue will panic on a nil value. if ctx == nil { + // Prevent trace.ContextWithSpan from panicking. ctx = context.Background() }