mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 22:01:29 +00:00
Transaction
err处理写反了
This commit is contained in:
parent
07c628c7e9
commit
8bd902814f
@ -117,7 +117,7 @@ o.Begin()
|
|||||||
...
|
...
|
||||||
user := User{Name: "slene"}
|
user := User{Name: "slene"}
|
||||||
id, err := o.Insert(&user)
|
id, err := o.Insert(&user)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
o.Commit()
|
o.Commit()
|
||||||
} else {
|
} else {
|
||||||
o.Rollback()
|
o.Rollback()
|
||||||
|
Loading…
Reference in New Issue
Block a user