mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen/template: remove receiver conflict handling logic (#4356)
* examples: ensure tests is stable * entc/gen/template: remove receiver conflict handling logic * examples: codegen * entc/integration: codegen
This commit is contained in:
@@ -20,8 +20,8 @@ type UserCreate struct {
|
||||
}
|
||||
|
||||
// SetLocation sets the "location" field.
|
||||
func (_c *UserCreate) SetLocation(b []byte) *UserCreate {
|
||||
_c.mutation.SetLocation(b)
|
||||
func (_c *UserCreate) SetLocation(v []byte) *UserCreate {
|
||||
_c.mutation.SetLocation(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate {
|
||||
}
|
||||
|
||||
// SetLocation sets the "location" field.
|
||||
func (_u *UserUpdate) SetLocation(b []byte) *UserUpdate {
|
||||
_u.mutation.SetLocation(b)
|
||||
func (_u *UserUpdate) SetLocation(v []byte) *UserUpdate {
|
||||
_u.mutation.SetLocation(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func (_u *UserUpdate) ExecX(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (_u *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
func (_u *UserUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
_spec := sqlgraph.NewUpdateSpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt))
|
||||
if ps := _u.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
@@ -77,7 +77,7 @@ func (_u *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if value, ok := _u.mutation.Location(); ok {
|
||||
_spec.SetField(user.FieldLocation, field.TypeBytes, value)
|
||||
}
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
||||
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{user.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
@@ -86,7 +86,7 @@ func (_u *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
return 0, err
|
||||
}
|
||||
_u.mutation.done = true
|
||||
return n, nil
|
||||
return _node, nil
|
||||
}
|
||||
|
||||
// UserUpdateOne is the builder for updating a single User entity.
|
||||
@@ -98,8 +98,8 @@ type UserUpdateOne struct {
|
||||
}
|
||||
|
||||
// SetLocation sets the "location" field.
|
||||
func (_u *UserUpdateOne) SetLocation(b []byte) *UserUpdateOne {
|
||||
_u.mutation.SetLocation(b)
|
||||
func (_u *UserUpdateOne) SetLocation(v []byte) *UserUpdateOne {
|
||||
_u.mutation.SetLocation(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user