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

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