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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

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

View File

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

View File

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