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:
@@ -116,8 +116,8 @@ func (cq *CarQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
return ids[0], nil
|
||||
}
|
||||
|
||||
// FirstXID is like FirstID, but panics if an error occurs.
|
||||
func (cq *CarQuery) FirstXID(ctx context.Context) int {
|
||||
// FirstIDX is like FirstID, but panics if an error occurs.
|
||||
func (cq *CarQuery) FirstIDX(ctx context.Context) int {
|
||||
id, err := cq.FirstID(ctx)
|
||||
if err != nil && !IsNotFound(err) {
|
||||
panic(err)
|
||||
|
||||
@@ -116,8 +116,8 @@ func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
return ids[0], nil
|
||||
}
|
||||
|
||||
// FirstXID is like FirstID, but panics if an error occurs.
|
||||
func (gq *GroupQuery) FirstXID(ctx context.Context) int {
|
||||
// FirstIDX is like FirstID, but panics if an error occurs.
|
||||
func (gq *GroupQuery) FirstIDX(ctx context.Context) int {
|
||||
id, err := gq.FirstID(ctx)
|
||||
if err != nil && !IsNotFound(err) {
|
||||
panic(err)
|
||||
|
||||
@@ -140,8 +140,8 @@ func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
return ids[0], nil
|
||||
}
|
||||
|
||||
// FirstXID is like FirstID, but panics if an error occurs.
|
||||
func (uq *UserQuery) FirstXID(ctx context.Context) int {
|
||||
// FirstIDX is like FirstID, but panics if an error occurs.
|
||||
func (uq *UserQuery) FirstIDX(ctx context.Context) int {
|
||||
id, err := uq.FirstID(ctx)
|
||||
if err != nil && !IsNotFound(err) {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user