check runs all checks and user-defined validators on the builder.
()
| 205 | |
| 206 | // check runs all checks and user-defined validators on the builder. |
| 207 | func (gcc *GitCommitCreate) check() error { |
| 208 | if _, ok := gcc.mutation.CreateTime(); !ok { |
| 209 | return &ValidationError{Name: "create_time", err: errors.New(`ent: missing required field "GitCommit.create_time"`)} |
| 210 | } |
| 211 | if _, ok := gcc.mutation.UpdateTime(); !ok { |
| 212 | return &ValidationError{Name: "update_time", err: errors.New(`ent: missing required field "GitCommit.update_time"`)} |
| 213 | } |
| 214 | if _, ok := gcc.mutation.CommitHash(); !ok { |
| 215 | return &ValidationError{Name: "commit_hash", err: errors.New(`ent: missing required field "GitCommit.commit_hash"`)} |
| 216 | } |
| 217 | if _, ok := gcc.mutation.BranchName(); !ok { |
| 218 | return &ValidationError{Name: "branch_name", err: errors.New(`ent: missing required field "GitCommit.branch_name"`)} |
| 219 | } |
| 220 | if _, ok := gcc.mutation.RepoName(); !ok { |
| 221 | return &ValidationError{Name: "repo_name", err: errors.New(`ent: missing required field "GitCommit.repo_name"`)} |
| 222 | } |
| 223 | if _, ok := gcc.mutation.CommitMessage(); !ok { |
| 224 | return &ValidationError{Name: "commit_message", err: errors.New(`ent: missing required field "GitCommit.commit_message"`)} |
| 225 | } |
| 226 | if _, ok := gcc.mutation.CommitTimestamp(); !ok { |
| 227 | return &ValidationError{Name: "commit_timestamp", err: errors.New(`ent: missing required field "GitCommit.commit_timestamp"`)} |
| 228 | } |
| 229 | return nil |
| 230 | } |
| 231 | |
| 232 | func (gcc *GitCommitCreate) sqlSave(ctx context.Context) (*GitCommit, error) { |
| 233 | if err := gcc.check(); err != nil { |
no test coverage detected