MCPcopy
hub / github.com/expr-lang/expr / WithContext

Function WithContext

expr.go:197–206  ·  view source on GitHub ↗

WithContext passes context to all functions calls with a context.Context argument.

(name string)

Source from the content-addressed store, hash-verified

195
196// WithContext passes context to all functions calls with a context.Context argument.
197func WithContext(name string) Option {
198 return func(c *conf.Config) {
199 c.Visitors = append(c.Visitors, patcher.WithContext{
200 Name: name,
201 Functions: c.Functions,
202 Env: &c.Env,
203 NtCache: &c.NtCache,
204 })
205 }
206}
207
208// Timezone sets default timezone for date() and now() builtin functions.
209func Timezone(name string) Option {

Callers 8

ExampleWithContextFunction · 0.92
TestIssue823Function · 0.92
TestIssue823_EnvMethodsFunction · 0.92
TestIssue756Function · 0.92
TestWithContext_issue529Function · 0.92

Calls

no outgoing calls

Tested by 8

ExampleWithContextFunction · 0.74
TestIssue823Function · 0.74
TestIssue823_EnvMethodsFunction · 0.74
TestIssue756Function · 0.74
TestWithContext_issue529Function · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…