diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-09 06:43:20 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-09 06:43:20 +0800 |
commit | 92b6667bd1cf7aad4a00331d761d8a92b03a7cae (patch) | |
tree | 01eba885b03343e576785082d90e3f786cf48261 /memory_database.go | |
parent | 9f42835a0204ba2508895c1d259340bcda843974 (diff) | |
download | go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.gz go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.zst go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.zip |
Minor update
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) + } +} |