test: perform check in view(readonly) mode

Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
Benjamin Wang 2023-03-20 11:00:38 +08:00
parent 0c2c0a257a
commit b91d901b74

View File

@ -117,7 +117,7 @@ func (db *DB) MustReopen() {
// MustCheck runs a consistency check on the database and panics if any errors are found. // MustCheck runs a consistency check on the database and panics if any errors are found.
func (db *DB) MustCheck() { func (db *DB) MustCheck() {
err := db.Update(func(tx *bolt.Tx) error { err := db.View(func(tx *bolt.Tx) error {
// Collect all the errors. // Collect all the errors.
var errors []error var errors []error
for err := range tx.Check() { for err := range tx.Check() {