diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-05-27 12:08:33 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-05-27 12:08:33 -0600 |
commit | 93338e17eccebb077f96aabc7edc8f1c98c1b79d (patch) | |
tree | fe1fdb4aed24d100cac337e18afce207674fd65e /cmd/bolt/check.go | |
parent | Merge branch 'master' of https://github.com/boltdb/bolt (diff) | |
parent | Remove DB.Check(). Allow read-only Tx.Check(). (diff) | |
download | dedo-93338e17eccebb077f96aabc7edc8f1c98c1b79d.tar.gz dedo-93338e17eccebb077f96aabc7edc8f1c98c1b79d.tar.xz |
Merge pull request #174 from benbjohnson/remove-db-check
Remove DB.Check(). Allow read-only Tx.Check().
Diffstat (limited to 'cmd/bolt/check.go')
-rw-r--r-- | cmd/bolt/check.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/bolt/check.go b/cmd/bolt/check.go index ec2ea69..1436aba 100644 --- a/cmd/bolt/check.go +++ b/cmd/bolt/check.go @@ -21,7 +21,12 @@ func Check(path string) { defer db.Close() // Perform consistency check. - if err := db.Check(); err != nil { + err = db.View(func(tx *bolt.Tx) error { + return tx.Check() + }) + + // Print out any errors that occur. + if err != nil { if errors, ok := err.(bolt.ErrorList); ok { for _, err := range errors { println(err) |