Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 99b17de

Browse files
authored
ddtrace/tracer: Clarify StartSpanFromContext as it has caused confusion several times (DataDog#1421)
1 parent 03a3099 commit 99b17de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ddtrace/tracer/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func SpanFromContext(ctx context.Context) (Span, bool) {
3737

3838
// StartSpanFromContext returns a new span with the given operation name and options. If a span
3939
// is found in the context, it will be used as the parent of the resulting span. If the ChildOf
40-
// option is passed, the span from context will take precedence over it as the parent span.
40+
// option is passed, it will only be used as the parent if there is no span found in `ctx`.
4141
func StartSpanFromContext(ctx context.Context, operationName string, opts ...StartSpanOption) (Span, context.Context) {
4242
// copy opts in case the caller reuses the slice in parallel
4343
// we will add at least 1, at most 2 items

0 commit comments

Comments
 (0)