MCPcopy
hub / github.com/caddyserver/caddy / NewContext

Function NewContext

context.go:65–68  ·  view source on GitHub ↗

NewContext provides a new context derived from the given context ctx. Normally, you will not need to call this function unless you are loading modules which have a different lifespan than the ones for the context the module was provisioned with. Be sure to call the cancel func when the context is to

(ctx Context)

Source from the content-addressed store, hash-verified

63// modules which are loaded will be properly unloaded.
64// See standard library context package's documentation.
65func NewContext(ctx Context) (Context, context.CancelFunc) {
66 newCtx, cancelCause := NewContextWithCause(ctx)
67 return newCtx, func() { cancelCause(nil) }
68}
69
70// NewContextWithCause is like NewContext but returns a context.CancelCauseFunc.
71// EXPERIMENTAL: This API is subject to change.

Callers 1

Calls 1

NewContextWithCauseFunction · 0.85

Tested by 1