bbolt/bolt.go
Ben Johnson 8dafb2312b Remove DB.Open() and only allow bolt.Open().
Per @tv42's suggestion, this commit removes the ability to reopen an
instance of DB. All open calls go through bolt.Open().

Fixes #103.
2014-03-31 11:22:27 -06:00

30 lines
628 B
Go

package bolt
import (
"fmt"
"os"
)
// 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 {
panic(fmt.Sprintf("assertion failed: "+msg, v...))
}
}
func warn(v ...interface{}) {
fmt.Fprintln(os.Stderr, v...)
}
func warnf(msg string, v ...interface{}) {
fmt.Fprintf(os.Stderr, msg+"\n", v...)
}