diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-16 12:11:10 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-16 12:11:10 -0700 |
commit | 6a7be8879bd7a33017c181018780bf5f4915b056 (patch) | |
tree | 5573bd653680219efba02cd11fd38ced6cdbf647 /db.go | |
parent | Improve test coverage. (diff) | |
download | dedo-6a7be8879bd7a33017c181018780bf5f4915b056.tar.gz dedo-6a7be8879bd7a33017c181018780bf5f4915b056.tar.xz |
Add Stringer support.
Diffstat (limited to 'db.go')
-rw-r--r-- | db.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,6 +1,7 @@ package bolt import ( + "fmt" "io" "os" "sync" @@ -42,6 +43,16 @@ func (db *DB) Path() string { return db.path } +// GoString returns the Go string representation of the database. +func (db *DB) GoString() string { + return fmt.Sprintf("bolt.DB{path:%q}", db.path) +} + +// String returns the string representation of the database. +func (db *DB) String() string { + return fmt.Sprintf("DB<%q>", db.path) +} + // Open opens a data file at the given path and initializes the database. // If the file does not exist then it will be created automatically. func (db *DB) Open(path string, mode os.FileMode) error { |