entc/gen: fix name clash in entc template when entity name has initials as tx (#2633)

This commit is contained in:
hax10
2022-06-10 01:39:46 +08:00
committed by GitHub
parent fd955654a0
commit e6152856b1
115 changed files with 231 additions and 231 deletions

View File

@@ -132,11 +132,11 @@ func (gr *Group) Update() *GroupUpdateOne {
// Unwrap unwraps the Group entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (gr *Group) Unwrap() *Group {
tx, ok := gr.config.driver.(*txDriver)
_tx, ok := gr.config.driver.(*txDriver)
if !ok {
panic("ent: Group is not a transactional entity")
}
gr.config.driver = tx.drv
gr.config.driver = _tx.drv
return gr
}

View File

@@ -132,11 +132,11 @@ func (pe *Pet) Update() *PetUpdateOne {
// Unwrap unwraps the Pet entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (pe *Pet) Unwrap() *Pet {
tx, ok := pe.config.driver.(*txDriver)
_tx, ok := pe.config.driver.(*txDriver)
if !ok {
panic("ent: Pet is not a transactional entity")
}
pe.config.driver = tx.drv
pe.config.driver = _tx.drv
return pe
}

View File

@@ -156,11 +156,11 @@ func (u *User) Update() *UserUpdateOne {
// Unwrap unwraps the User entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (u *User) Unwrap() *User {
tx, ok := u.config.driver.(*txDriver)
_tx, ok := u.config.driver.(*txDriver)
if !ok {
panic("ent: User is not a transactional entity")
}
u.config.driver = tx.drv
u.config.driver = _tx.drv
return u
}