mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-04-29 07:18:57 +00:00
db: return t.Rollback directly in the end of View function
Make return line of db.View corresponding with db.Update.
This commit is contained in:
parent
4ff482b44e
commit
ea18f34f9d
6
db.go
6
db.go
@ -687,11 +687,7 @@ func (db *DB) View(fn func(*Tx) error) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := t.Rollback(); err != nil {
|
return t.Rollback()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch calls fn as part of a batch. It behaves similar to Update,
|
// Batch calls fn as part of a batch. It behaves similar to Update,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user