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

Method Set

cel/validator.go:202–209  ·  view source on GitHub ↗

Set configures a validator option with the given name and value. If the value had previously been set, the new value must have the same reflection type as the old one, or the call will error.

(name string, value any)

Source from the content-addressed store, hash-verified

200// If the value had previously been set, the new value must have the same reflection type as the old one,
201// or the call will error.
202func (config *validatorConfig) Set(name string, value any) error {
203 v, found := config.data[name]
204 if found && reflect.TypeOf(v) != reflect.TypeOf(value) {
205 return fmt.Errorf("incompatible configuration type for %s, got %T, wanted %T", name, value, v)
206 }
207 config.data[name] = value
208 return nil
209}
210
211// ExtendedValidations collects a set of common AST validations which reduce the likelihood of runtime errors.
212//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected