aboutsummaryrefslogtreecommitdiff
path: root/bolt.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-03-28 00:07:05 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-03-29 14:22:32 -0600
commit7f2de9f17a8c6113176ecb5a3eb6ecc0772a9ec1 (patch)
treed8381077fb0d78b86219491d5331589cf470042a /bolt.go
parentMerge pull request #97 from benbjohnson/cli (diff)
downloaddedo-7f2de9f17a8c6113176ecb5a3eb6ecc0772a9ec1.tar.gz
dedo-7f2de9f17a8c6113176ecb5a3eb6ecc0772a9ec1.tar.xz
Add DB.Check().
Diffstat (limited to 'bolt.go')
-rw-r--r--bolt.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/bolt.go b/bolt.go
index f258731..538c5a9 100644
--- a/bolt.go
+++ b/bolt.go
@@ -15,6 +15,14 @@ func Open(path string, mode os.FileMode) (*DB, error) {
return db, nil
}
+// ErrorList represents a slice of errors.
+type ErrorList []error
+
+// Error returns a readable count of the errors in the list.
+func (l ErrorList) Error() string {
+ return fmt.Sprintf("%d errors occurred", len(l))
+}
+
// _assert will panic with a given formatted message if the given condition is false.
func _assert(condition bool, msg string, v ...interface{}) {
if !condition {