mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30: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 {
|
||||
}
|
||||
|
||||
// SetName sets the "name" field.
|
||||
func (_c *UserCreate) SetName(s string) *UserCreate {
|
||||
_c.mutation.SetName(s)
|
||||
func (_c *UserCreate) SetName(v string) *UserCreate {
|
||||
_c.mutation.SetName(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
|
||||
@@ -28,15 +28,15 @@ func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate {
|
||||
}
|
||||
|
||||
// SetName sets the "name" field.
|
||||
func (_u *UserUpdate) SetName(s string) *UserUpdate {
|
||||
_u.mutation.SetName(s)
|
||||
func (_u *UserUpdate) SetName(v string) *UserUpdate {
|
||||
_u.mutation.SetName(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableName sets the "name" field if the given value is not nil.
|
||||
func (_u *UserUpdate) SetNillableName(s *string) *UserUpdate {
|
||||
if s != nil {
|
||||
_u.SetName(*s)
|
||||
func (_u *UserUpdate) SetNillableName(v *string) *UserUpdate {
|
||||
if v != nil {
|
||||
_u.SetName(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
@@ -73,7 +73,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) {
|
||||
@@ -85,7 +85,7 @@ func (_u *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if value, ok := _u.mutation.Name(); ok {
|
||||
_spec.SetField(user.FieldName, field.TypeString, 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) {
|
||||
@@ -94,7 +94,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.
|
||||
@@ -106,15 +106,15 @@ type UserUpdateOne struct {
|
||||
}
|
||||
|
||||
// SetName sets the "name" field.
|
||||
func (_u *UserUpdateOne) SetName(s string) *UserUpdateOne {
|
||||
_u.mutation.SetName(s)
|
||||
func (_u *UserUpdateOne) SetName(v string) *UserUpdateOne {
|
||||
_u.mutation.SetName(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableName sets the "name" field if the given value is not nil.
|
||||
func (_u *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne {
|
||||
if s != nil {
|
||||
_u.SetName(*s)
|
||||
func (_u *UserUpdateOne) SetNillableName(v *string) *UserUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetName(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user