aboutsummaryrefslogtreecommitdiff
path: root/bolt.go
diff options
context:
space:
mode:
Diffstat (limited to 'bolt.go')
-rw-r--r--bolt.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/bolt.go b/bolt.go
index bb5a2de..f258731 100644
--- a/bolt.go
+++ b/bolt.go
@@ -1,6 +1,7 @@
package bolt
import (
+ "fmt"
"os"
)
@@ -13,3 +14,18 @@ func Open(path string, mode os.FileMode) (*DB, error) {
}
return db, nil
}
+
+// _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...)
+}