forked from golang/hotime
完善error库
This commit is contained in:
parent
0e2932ca89
commit
95489fcf49
2
db/db.go
2
db/db.go
@ -42,7 +42,7 @@ func (that *HoTimeDB) GetType() string {
|
|||||||
|
|
||||||
// Action 事务,如果action返回true则执行成功;false则回滚
|
// Action 事务,如果action返回true则执行成功;false则回滚
|
||||||
func (that *HoTimeDB) Action(action func(db HoTimeDB) bool) bool {
|
func (that *HoTimeDB) Action(action func(db HoTimeDB) bool) bool {
|
||||||
db := HoTimeDB{DB: that.DB, HoTimeCache: that.HoTimeCache}
|
db := HoTimeDB{DB: that.DB, HoTimeCache: that.HoTimeCache, Prefix: that.Prefix}
|
||||||
tx, err := db.Begin()
|
tx, err := db.Begin()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
that.LastErr.SetError(err)
|
that.LastErr.SetError(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user