MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Variable

Function Variable

cel/decls.go:144–146  ·  view source on GitHub ↗

Variable creates an instance of a variable declaration with a variable name and type.

(name string, t *Type)

Source from the content-addressed store, hash-verified

142
143// Variable creates an instance of a variable declaration with a variable name and type.
144func Variable(name string, t *Type) EnvOption {
145 return VariableWithDoc(name, t, "")
146}
147
148// VariableWithDoc creates an instance of a variable declaration with a variable name, type, and doc string.
149func VariableWithDoc(name string, t *Type, doc string) EnvOption {

Callers 15

OptimizeMethod · 0.92
OptimizeMethod · 0.92
compileRuleMethod · 0.92
bench.goFile · 0.92
TestStringFormatFunction · 0.92
TestListsCostsFunction · 0.92
TestStringFormatV2Function · 0.92
TestNativeStructEmbeddedFunction · 0.92
TestNativeNestedStructFunction · 0.92
testNativeEnvFunction · 0.92
TestSetsFunction · 0.92

Calls 1

VariableWithDocFunction · 0.85

Tested by 15

TestStringFormatFunction · 0.74
TestListsCostsFunction · 0.74
TestStringFormatV2Function · 0.74
TestNativeStructEmbeddedFunction · 0.74
TestNativeNestedStructFunction · 0.74
testNativeEnvFunction · 0.74
TestSetsFunction · 0.74
TestBlockEvalFunction · 0.74
TestBlockEval_BadPlanFunction · 0.74
TestBlockEval_BadBlockFunction · 0.74