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:
@@ -222,7 +222,7 @@ func (c *CardClient) GetX(ctx context.Context, id int) *Card {
|
||||
// QueryOwner queries the owner edge of a Card.
|
||||
func (c *CardClient) QueryOwner(ca *Card) *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 := ca.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(card.Table, card.FieldID, id),
|
||||
@@ -329,7 +329,7 @@ func (c *UserClient) GetX(ctx context.Context, id int) *User {
|
||||
// QueryCards queries the cards edge of a User.
|
||||
func (c *UserClient) QueryCards(u *User) *CardQuery {
|
||||
query := &CardQuery{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),
|
||||
@@ -345,7 +345,7 @@ func (c *UserClient) QueryCards(u *User) *CardQuery {
|
||||
// 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),
|
||||
@@ -361,7 +361,7 @@ func (c *UserClient) QueryFriends(u *User) *UserQuery {
|
||||
// QueryBestFriend queries the best_friend edge of a User.
|
||||
func (c *UserClient) QueryBestFriend(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),
|
||||
|
||||
@@ -549,7 +549,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{}{}
|
||||
|
||||
Reference in New Issue
Block a user