check runs all checks and user-defined validators on the builder.
()
| 643 | |
| 644 | // check runs all checks and user-defined validators on the builder. |
| 645 | func (nuo *NodeUpdateOne) check() error { |
| 646 | if v, ok := nuo.mutation.Status(); ok { |
| 647 | if err := node.StatusValidator(v); err != nil { |
| 648 | return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Node.status": %w`, err)} |
| 649 | } |
| 650 | } |
| 651 | if v, ok := nuo.mutation.GetType(); ok { |
| 652 | if err := node.TypeValidator(v); err != nil { |
| 653 | return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Node.type": %w`, err)} |
| 654 | } |
| 655 | } |
| 656 | return nil |
| 657 | } |
| 658 | |
| 659 | func (nuo *NodeUpdateOne) sqlSave(ctx context.Context) (_node *Node, err error) { |
| 660 | if err := nuo.check(); err != nil { |
no test coverage detected