MCPcopy Index your code
hub / github.com/coder/coder / WithSource

Function WithSource

coderd/aibridge/factory.go:21–23  ·  view source on GitHub ↗

WithSource returns a copy of ctx carrying the given Source. Use this on the request context before invoking a downstream handler so [SourceFromContext] can recover it for logging.

(ctx context.Context, src Source)

Source from the content-addressed store, hash-verified

19// request context before invoking a downstream handler so [SourceFromContext]
20// can recover it for logging.
21func WithSource(ctx context.Context, src Source) context.Context {
22 return context.WithValue(ctx, sourceCtxKey{}, src)
23}
24
25// SourceFromContext returns the Source attached by [WithSource], or the empty
26// string when no Source is set.

Callers 1

RoundTripMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected