diff options
Diffstat (limited to 'memory_database.go')
-rw-r--r-- | memory_database.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/memory_database.go b/memory_database.go index fc40f76f3..a8c74bb46 100644 --- a/memory_database.go +++ b/memory_database.go @@ -1,6 +1,7 @@ package main import ( + "fmt" ) /* @@ -23,3 +24,11 @@ func (db *MemDatabase) Put(key []byte, value []byte) { func (db *MemDatabase) Get(key []byte) ([]byte, error) { return db.db[string(key)], nil } + +func (db *MemDatabase) Print() { + for key, val := range db.db { + fmt.Printf("%x(%d):", key, len(key)) + decoded := DecodeNode(val) + PrintSlice(decoded) + } +} |