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

@@ -101,11 +101,11 @@ func (a *Account) Update() *AccountUpdateOne {
// Unwrap unwraps the Account 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 (a *Account) Unwrap() *Account {
tx, ok := a.config.driver.(*txDriver)
_tx, ok := a.config.driver.(*txDriver)
if !ok {
panic("ent: Account is not a transactional entity")
}
a.config.driver = tx.drv
a.config.driver = _tx.drv
return a
}

View File

@@ -140,11 +140,11 @@ func (b *Blob) Update() *BlobUpdateOne {
// Unwrap unwraps the Blob 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 (b *Blob) Unwrap() *Blob {
tx, ok := b.config.driver.(*txDriver)
_tx, ok := b.config.driver.(*txDriver)
if !ok {
panic("ent: Blob is not a transactional entity")
}
b.config.driver = tx.drv
b.config.driver = _tx.drv
return b
}

View File

@@ -134,11 +134,11 @@ func (c *Car) Update() *CarUpdateOne {
// Unwrap unwraps the Car 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 (c *Car) Unwrap() *Car {
tx, ok := c.config.driver.(*txDriver)
_tx, ok := c.config.driver.(*txDriver)
if !ok {
panic("ent: Car is not a transactional entity")
}
c.config.driver = tx.drv
c.config.driver = _tx.drv
return c
}

View File

@@ -123,11 +123,11 @@ func (d *Device) Update() *DeviceUpdateOne {
// Unwrap unwraps the Device 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 (d *Device) Unwrap() *Device {
tx, ok := d.config.driver.(*txDriver)
_tx, ok := d.config.driver.(*txDriver)
if !ok {
panic("ent: Device is not a transactional entity")
}
d.config.driver = tx.drv
d.config.driver = _tx.drv
return d
}

View File

@@ -132,11 +132,11 @@ func (d *Doc) Update() *DocUpdateOne {
// Unwrap unwraps the Doc 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 (d *Doc) Unwrap() *Doc {
tx, ok := d.config.driver.(*txDriver)
_tx, ok := d.config.driver.(*txDriver)
if !ok {
panic("ent: Doc is not a transactional entity")
}
d.config.driver = tx.drv
d.config.driver = _tx.drv
return d
}

View File

@@ -90,11 +90,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

@@ -83,11 +83,11 @@ func (mi *MixinID) Update() *MixinIDUpdateOne {
// Unwrap unwraps the MixinID 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 (mi *MixinID) Unwrap() *MixinID {
tx, ok := mi.config.driver.(*txDriver)
_tx, ok := mi.config.driver.(*txDriver)
if !ok {
panic("ent: MixinID is not a transactional entity")
}
mi.config.driver = tx.drv
mi.config.driver = _tx.drv
return mi
}

View File

@@ -130,11 +130,11 @@ func (n *Note) Update() *NoteUpdateOne {
// Unwrap unwraps the Note 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 (n *Note) Unwrap() *Note {
tx, ok := n.config.driver.(*txDriver)
_tx, ok := n.config.driver.(*txDriver)
if !ok {
panic("ent: Note is not a transactional entity")
}
n.config.driver = tx.drv
n.config.driver = _tx.drv
return n
}

View File

@@ -64,11 +64,11 @@ func (o *Other) Update() *OtherUpdateOne {
// Unwrap unwraps the Other 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 (o *Other) Unwrap() *Other {
tx, ok := o.config.driver.(*txDriver)
_tx, ok := o.config.driver.(*txDriver)
if !ok {
panic("ent: Other is not a transactional entity")
}
o.config.driver = tx.drv
o.config.driver = _tx.drv
return o
}

View File

@@ -169,11 +169,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

@@ -64,11 +64,11 @@ func (r *Revision) Update() *RevisionUpdateOne {
// Unwrap unwraps the Revision 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 (r *Revision) Unwrap() *Revision {
tx, ok := r.config.driver.(*txDriver)
_tx, ok := r.config.driver.(*txDriver)
if !ok {
panic("ent: Revision is not a transactional entity")
}
r.config.driver = tx.drv
r.config.driver = _tx.drv
return r
}

View File

@@ -107,11 +107,11 @@ func (s *Session) Update() *SessionUpdateOne {
// Unwrap unwraps the Session 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 (s *Session) Unwrap() *Session {
tx, ok := s.config.driver.(*txDriver)
_tx, ok := s.config.driver.(*txDriver)
if !ok {
panic("ent: Session is not a transactional entity")
}
s.config.driver = tx.drv
s.config.driver = _tx.drv
return s
}

View File

@@ -117,11 +117,11 @@ func (t *Token) Update() *TokenUpdateOne {
// Unwrap unwraps the Token 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 (t *Token) Unwrap() *Token {
tx, ok := t.config.driver.(*txDriver)
_tx, ok := t.config.driver.(*txDriver)
if !ok {
panic("ent: Token is not a transactional entity")
}
t.config.driver = tx.drv
t.config.driver = _tx.drv
return t
}

View File

@@ -153,11 +153,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
}