mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: rename FirstXID to FirstIDX (#854)
This commit is contained in:
@@ -139,8 +139,8 @@ func (nq *NodeQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
return ids[0], nil
|
||||
}
|
||||
|
||||
// FirstXID is like FirstID, but panics if an error occurs.
|
||||
func (nq *NodeQuery) FirstXID(ctx context.Context) int {
|
||||
// FirstIDX is like FirstID, but panics if an error occurs.
|
||||
func (nq *NodeQuery) FirstIDX(ctx context.Context) int {
|
||||
id, err := nq.FirstID(ctx)
|
||||
if err != nil && !IsNotFound(err) {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user