MCPcopy
hub / github.com/rs/zerolog / IDFromCtx

Function IDFromCtx

hlog/hlog.go:195–198  ·  view source on GitHub ↗

IDFromCtx returns the unique id associated to the context if any.

(ctx context.Context)

Source from the content-addressed store, hash-verified

193
194// IDFromCtx returns the unique id associated to the context if any.
195func IDFromCtx(ctx context.Context) (id xid.ID, ok bool) {
196 id, ok = ctx.Value(idKey{}).(xid.ID)
197 return
198}
199
200// CtxWithID adds the given xid.ID to the context
201func CtxWithID(ctx context.Context, id xid.ID) context.Context {

Callers 1

IDFromRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected