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

Method GetOrDefault

cel/validator.go:190–196  ·  view source on GitHub ↗

GetOrDefault returns the configured value for the name, if present, else the input default value. Note, the type-agreement between the input default and configured value is not checked on read.

(name string, value any)

Source from the content-addressed store, hash-verified

188//
189// Note, the type-agreement between the input default and configured value is not checked on read.
190func (config *validatorConfig) GetOrDefault(name string, value any) any {
191 v, found := config.data[name]
192 if !found {
193 return value
194 }
195 return v
196}
197
198// Set configures a validator option with the given name and value.
199//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected