Skip to content

Commit 78403ec

Browse files
authored
ctx WithValue (#7)
1 parent 0680e91 commit 78403ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ctxtrace.go

+5
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,8 @@ func packCallerMetadata(m *metadata.MD, data TraceData) {
181181
m.Set(headerRequestID, data.RequestID)
182182
}
183183
}
184+
185+
// WithValue Creates context with TraceData values
186+
func WithValue(ctx context.Context, traceData TraceData) context.Context {
187+
return context.WithValue(ctx, traceCtxMarker{}, traceData)
188+
}

0 commit comments

Comments
 (0)