diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-07 15:03:29 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-07 15:03:29 -0700 |
commit | 84939c21f68e6d4158cf2506851ab4db2f0afe78 (patch) | |
tree | 53ed265c1c46f04784831084aa74491f4fe115ed /assert.go | |
parent | Clean up. (diff) | |
download | dedo-84939c21f68e6d4158cf2506851ab4db2f0afe78.tar.gz dedo-84939c21f68e6d4158cf2506851ab4db2f0afe78.tar.xz |
Refactor node lookup.
Diffstat (limited to 'assert.go')
-rw-r--r-- | assert.go | 12 |
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...)) + } +} |