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

@@ -236,7 +236,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),
@@ -522,7 +522,7 @@ func (c *UserClient) GetX(ctx context.Context, id int) *User {
// QueryParent queries the parent edge of a User.
func (c *UserClient) QueryParent(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),
@@ -538,7 +538,7 @@ func (c *UserClient) QueryParent(u *User) *UserQuery {
// QueryChildren queries the children edge of a User.
func (c *UserClient) QueryChildren(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),
@@ -554,7 +554,7 @@ func (c *UserClient) QueryChildren(u *User) *UserQuery {
// QuerySpouse queries the spouse edge of a User.
func (c *UserClient) QuerySpouse(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),
@@ -570,7 +570,7 @@ func (c *UserClient) QuerySpouse(u *User) *UserQuery {
// QueryCar queries the car edge of a User.
func (c *UserClient) QueryCar(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),

View File

@@ -264,7 +264,7 @@ func (c *BlogClient) GetX(ctx context.Context, id int) *Blog {
// QueryAdmins queries the admins edge of a Blog.
func (c *BlogClient) QueryAdmins(b *Blog) *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 := b.ID
step := sqlgraph.NewStep(
sqlgraph.From(blog.Table, blog.FieldID, id),
@@ -370,7 +370,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),
@@ -836,7 +836,7 @@ func (c *PetClient) GetX(ctx context.Context, id int) *Pet {
// 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),
@@ -942,7 +942,7 @@ func (c *UserClient) GetX(ctx context.Context, id int) *User {
// QueryCar queries the car edge of a User.
func (c *UserClient) QueryCar(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),
@@ -958,7 +958,7 @@ func (c *UserClient) QueryCar(u *User) *CarQuery {
// 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),
@@ -974,7 +974,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),

View File

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