MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / check

Method check

app/controlplane/pkg/data/ent/user_create.go:199–215  ·  view source on GitHub ↗

check runs all checks and user-defined validators on the builder.

()

Source from the content-addressed store, hash-verified

197
198// check runs all checks and user-defined validators on the builder.
199func (_c *UserCreate) check() error {
200 if _, ok := _c.mutation.Email(); !ok {
201 return &ValidationError{Name: "email", err: errors.New(`ent: missing required field "User.email"`)}
202 }
203 if v, ok := _c.mutation.Email(); ok {
204 if err := user.EmailValidator(v); err != nil {
205 return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "User.email": %w`, err)}
206 }
207 }
208 if _, ok := _c.mutation.CreatedAt(); !ok {
209 return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "User.created_at"`)}
210 }
211 if _, ok := _c.mutation.UpdatedAt(); !ok {
212 return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "User.updated_at"`)}
213 }
214 return nil
215}
216
217func (_c *UserCreate) sqlSave(ctx context.Context) (*User, error) {
218 if err := _c.check(); err != nil {

Callers 2

sqlSaveMethod · 0.95
SaveMethod · 0.45

Calls 3

EmailMethod · 0.80
CreatedAtMethod · 0.45
UpdatedAtMethod · 0.45

Tested by

no test coverage detected