Commit b8b8f537 authored by Jeromy's avatar Jeromy

address jbenets comments on the pull request #1

parent 1102a7d1
...@@ -63,13 +63,13 @@ func (d *Datastore) Delete(key ds.Key) (err error) { ...@@ -63,13 +63,13 @@ func (d *Datastore) Delete(key ds.Key) (err error) {
return err return err
} }
func (d *Datastore) KeyList() []ds.Key { func (d *Datastore) KeyList() ([]ds.Key, error) {
i := d.DB.NewIterator(nil, nil) i := d.DB.NewIterator(nil, nil)
var keys []ds.Key var keys []ds.Key
for ; i.Valid(); i.Next() { for ; i.Valid(); i.Next() {
keys = append(keys, ds.NewKey(string(i.Key()))) keys = append(keys, ds.NewKey(string(i.Key())))
} }
return keys return keys, nil
} }
// LevelDB needs to be closed. // LevelDB needs to be closed.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment