map default namespace try

This commit is contained in:
Bel LaPointe
2019-11-12 13:38:20 -07:00
parent f807cc71b2
commit 283c2dffd2
17 changed files with 10 additions and 22 deletions

7
map.go Normal file → Executable file
View File

@@ -33,10 +33,11 @@ func (m *Map) List(ns []string, limits ...string) ([]string, error) {
limits = resolveLimits(limits)
keys := []string{}
if _, ok := (*m)[namespace]; !ok {
return nil, nil
n, _ := (*m)[DefaultNamespace]
if v, ok := (*m)[namespace]; ok {
n = v
}
for k := range (*m)[namespace] {
for k := range n {
if k >= limits[0] && k <= limits[1] {
keys = append(keys, k)
}