mirror of https://github.com/etcd-io/bbolt.git
db: return t.Rollback directly in the end of View function
Make return line of db.View corresponding with db.Update.pull/41/head
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…
Reference in New Issue