aboutsummaryrefslogtreecommitdiff
path: root/assert.go
diff options
context:
space:
mode:
Diffstat (limited to 'assert.go')
-rw-r--r--assert.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/assert.go b/assert.go
new file mode 100644
index 0000000..912e484
--- /dev/null
+++ b/assert.go
@@ -0,0 +1,12 @@
+package bolt
+
+import "fmt"
+
+// TODO(benbjohnson): Remove assertions before release.
+
+// __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...))
+ }
+}