MCPcopy Index your code
hub / github.com/expr-lang/expr / Env

Function Env

expr.go:29–33  ·  view source on GitHub ↗

Env specifies expected input of env for type checks. If struct is passed, all fields will be treated as variables, as well as all fields of embedded structs and struct itself. If map is passed, all items will be treated as variables. Methods defined on this type will be available as functions.

(env any)

Source from the content-addressed store, hash-verified

27// If map is passed, all items will be treated as variables.
28// Methods defined on this type will be available as functions.
29func Env(env any) Option {
30 return func(c *conf.Config) {
31 c.WithEnv(env)
32 }
33}
34
35// AllowUndefinedVariables allows to use undefined variables inside expressions.
36// This can be used with expr.Env option to partially define a few variables.

Callers

nothing calls this directly

Calls 1

WithEnvMethod · 0.80

Tested by

no test coverage detected