mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Remove unused variable and type redundancy (#2996)
This commit is contained in:
@@ -229,7 +229,7 @@ func (c *GroupClient) GetX(ctx context.Context, id int) *Group {
|
||||
// QueryUsers queries the users edge of a Group.
|
||||
func (c *GroupClient) QueryUsers(gr *Group) *UserQuery {
|
||||
query := &UserQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := gr.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(group.Table, group.FieldID, id),
|
||||
@@ -245,7 +245,7 @@ func (c *GroupClient) QueryUsers(gr *Group) *UserQuery {
|
||||
// QueryAdmin queries the admin edge of a Group.
|
||||
func (c *GroupClient) QueryAdmin(gr *Group) *UserQuery {
|
||||
query := &UserQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := gr.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(group.Table, group.FieldID, id),
|
||||
@@ -351,7 +351,7 @@ func (c *PetClient) GetX(ctx context.Context, id int) *Pet {
|
||||
// QueryFriends queries the friends edge of a Pet.
|
||||
func (c *PetClient) QueryFriends(pe *Pet) *PetQuery {
|
||||
query := &PetQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := pe.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(pet.Table, pet.FieldID, id),
|
||||
@@ -367,7 +367,7 @@ func (c *PetClient) QueryFriends(pe *Pet) *PetQuery {
|
||||
// QueryOwner queries the owner edge of a Pet.
|
||||
func (c *PetClient) QueryOwner(pe *Pet) *UserQuery {
|
||||
query := &UserQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := pe.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(pet.Table, pet.FieldID, id),
|
||||
@@ -473,7 +473,7 @@ func (c *UserClient) GetX(ctx context.Context, id int) *User {
|
||||
// QueryPets queries the pets edge of a User.
|
||||
func (c *UserClient) QueryPets(u *User) *PetQuery {
|
||||
query := &PetQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := u.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(user.Table, user.FieldID, id),
|
||||
@@ -489,7 +489,7 @@ func (c *UserClient) QueryPets(u *User) *PetQuery {
|
||||
// QueryFriends queries the friends edge of a User.
|
||||
func (c *UserClient) QueryFriends(u *User) *UserQuery {
|
||||
query := &UserQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := u.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(user.Table, user.FieldID, id),
|
||||
@@ -505,7 +505,7 @@ func (c *UserClient) QueryFriends(u *User) *UserQuery {
|
||||
// QueryGroups queries the groups edge of a User.
|
||||
func (c *UserClient) QueryGroups(u *User) *GroupQuery {
|
||||
query := &GroupQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := u.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(user.Table, user.FieldID, id),
|
||||
@@ -521,7 +521,7 @@ func (c *UserClient) QueryGroups(u *User) *GroupQuery {
|
||||
// QueryManage queries the manage edge of a User.
|
||||
func (c *UserClient) QueryManage(u *User) *GroupQuery {
|
||||
query := &GroupQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := u.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(user.Table, user.FieldID, id),
|
||||
|
||||
@@ -475,7 +475,7 @@ func (gq *GroupQuery) loadUsers(ctx context.Context, query *UserQuery, nodes []*
|
||||
outValue := int(values[0].(*sql.NullInt64).Int64)
|
||||
inValue := int(values[1].(*sql.NullInt64).Int64)
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*Group]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*Group]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
|
||||
@@ -475,7 +475,7 @@ func (pq *PetQuery) loadFriends(ctx context.Context, query *PetQuery, nodes []*P
|
||||
outValue := int(values[0].(*sql.NullInt64).Int64)
|
||||
inValue := int(values[1].(*sql.NullInt64).Int64)
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*Pet]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*Pet]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
|
||||
@@ -586,7 +586,7 @@ func (uq *UserQuery) loadFriends(ctx context.Context, query *UserQuery, nodes []
|
||||
outValue := int(values[0].(*sql.NullInt64).Int64)
|
||||
inValue := int(values[1].(*sql.NullInt64).Int64)
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*User]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*User]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
@@ -644,7 +644,7 @@ func (uq *UserQuery) loadGroups(ctx context.Context, query *GroupQuery, nodes []
|
||||
outValue := int(values[0].(*sql.NullInt64).Int64)
|
||||
inValue := int(values[1].(*sql.NullInt64).Int64)
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*User]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*User]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
|
||||
Reference in New Issue
Block a user