From c0b6d70899ec0efd6a8551846aab78fad37be9b9 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 11 Oct 2018 15:27:33 -0600 Subject: [PATCH] Fix reverse listing in bolt --- store/bolt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/bolt.go b/store/bolt.go index 3c3c464..dc1dc57 100644 --- a/store/bolt.go +++ b/store/bolt.go @@ -48,8 +48,8 @@ func (bc *BoltClient) List(namespace, key string, asc bool, limit int) ([]string found = append(found, string(k)) } } else { - key += "}}}}}}}}}}}}}}}}}}}}}}}}}}}}}" - for k, _ := c.Seek([]byte(key)); k != nil && len(found) < limit; k, _ = c.Prev() { + c.Seek([]byte(key + "}}}}}}}}}}}}}}")) + for k, _ := c.Prev(); k != nil && len(found) < limit; k, _ = c.Prev() { found = append(found, string(k)) } }