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)
| 188 | // |
| 189 | // Note, the type-agreement between the input default and configured value is not checked on read. |
| 190 | func (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 | // |
nothing calls this directly
no outgoing calls
no test coverage detected