From 7f2de9f17a8c6113176ecb5a3eb6ecc0772a9ec1 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Fri, 28 Mar 2014 00:07:05 -0600 Subject: Add DB.Check(). --- bolt.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bolt.go') 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 { -- cgit v1.2.3