store/memory: fixup

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-07-15 12:11:55 +03:00
parent 1e43122660
commit f54658830d

View File

@ -77,12 +77,10 @@ func (m *memoryStore) list(prefix string, limit, offset uint) []string {
if !strings.HasPrefix(k, prefix) {
continue
}
if prefix == "" {
allKeys[i] = strings.TrimPrefix(k, "/")
} else {
allKeys[i] = strings.TrimPrefix(k, prefix)
allKeys[i] = strings.TrimPrefix(k, prefix)
if allKeys[i][0] == '/' {
allKeys[i] = allKeys[i][1:]
}
allKeys[i] = strings.TrimPrefix(allKeys[i], "/")
i++
}
if limit != 0 || offset != 0 {