From 92b6667bd1cf7aad4a00331d761d8a92b03a7cae Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 8 Jan 2014 23:43:20 +0100 Subject: Minor update --- memory_database.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'memory_database.go') 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) + } +} -- cgit