validateSet runs the validation on all the set expressions that define one.
(set ExpressionSet)
| 223 | |
| 224 | // validateSet runs the validation on all the set expressions that define one. |
| 225 | func validateSet(set ExpressionSet) { |
| 226 | errors := &ValidationErrors{} |
| 227 | for _, def := range set { |
| 228 | if def == nil { |
| 229 | continue |
| 230 | } |
| 231 | if validate, ok := def.(Validator); ok { |
| 232 | if err := validate.Validate(); err != nil { |
| 233 | errors.AddError(def, err) |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | if len(errors.Errors) > 0 { |
| 238 | Context.Record(&Error{GoError: errors}) |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | // finalizeSet runs the finalizer on all the set expressions that define one. |
| 243 | func finalizeSet(set ExpressionSet) { |