Remove unused variable and type redundancy (#2996)

This commit is contained in:
Marwan Sulaiman
2022-10-08 17:59:52 -04:00
committed by GitHub
parent a8dde5e0d1
commit 713828b311
63 changed files with 250 additions and 256 deletions

View File

@@ -229,7 +229,7 @@ func (c *CarClient) GetX(ctx context.Context, id int) *Car {
// QueryOwner queries the owner edge of a Car.
func (c *CarClient) QueryOwner(ca *Car) *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(car.Table, car.FieldID, id),
@@ -335,7 +335,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),
@@ -441,7 +441,7 @@ func (c *UserClient) GetX(ctx context.Context, id int) *User {
// QueryCars queries the cars edge of a User.
func (c *UserClient) QueryCars(u *User) *CarQuery {
query := &CarQuery{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),
@@ -457,7 +457,7 @@ func (c *UserClient) QueryCars(u *User) *CarQuery {
// 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),

View File

@@ -425,7 +425,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{}{}

View File

@@ -500,7 +500,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{}{}