FirstID returns the first GitCommit ID from the query. Returns a *NotFoundError when no GitCommit ID was found.
(ctx context.Context)
| 111 | // FirstID returns the first GitCommit ID from the query. |
| 112 | // Returns a *NotFoundError when no GitCommit ID was found. |
| 113 | func (gcq *GitCommitQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) { |
| 114 | var ids []uuid.UUID |
| 115 | if ids, err = gcq.Limit(1).IDs(setContextOp(ctx, gcq.ctx, ent.OpQueryFirstID)); err != nil { |
| 116 | return |
| 117 | } |
| 118 | if len(ids) == 0 { |
| 119 | err = &NotFoundError{gitcommit.Label} |
| 120 | return |
| 121 | } |
| 122 | return ids[0], nil |
| 123 | } |
| 124 | |
| 125 | // FirstIDX is like FirstID, but panics if an error occurs. |
| 126 | func (gcq *GitCommitQuery) FirstIDX(ctx context.Context) uuid.UUID { |
no test coverage detected