diff options
Diffstat (limited to 'bolt.go')
-rw-r--r-- | bolt.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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...) +} |