Commit 8bd90281 authored by Hubery's avatar Hubery

Transaction

err处理写反了
parent 07c628c7
......@@ -117,7 +117,7 @@ o.Begin()
...
user := User{Name: "slene"}
id, err := o.Insert(&user)
if err != nil {
if err == nil {
o.Commit()
} else {
o.Rollback()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment