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

Function CtxWithID

hlog/hlog.go:201–203  ·  view source on GitHub ↗

CtxWithID adds the given xid.ID to the context

(ctx context.Context, id xid.ID)

Source from the content-addressed store, hash-verified

199
200// CtxWithID adds the given xid.ID to the context
201func CtxWithID(ctx context.Context, id xid.ID) context.Context {
202 return context.WithValue(ctx, idKey{}, id)
203}
204
205// RequestIDHandler returns a handler setting a unique id to the request which can
206// be gathered using IDFromRequest(req). This generated id is added as a field to the

Callers 2

RequestIDHandlerFunction · 0.85
TestCtxWithIDFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestCtxWithIDFunction · 0.68