diff --git a/filtering.go b/filtering.go index 7eacd49..82db975 100644 --- a/filtering.go +++ b/filtering.go @@ -14,12 +14,12 @@ func (f Filter) Get(key string) (values []string, ok bool) { return values, ok } -func (f Filter) Size() int { +func (f Filter) Count() int { return len(f) } -func (f Filter) IsNotEmpty() bool { - return len(f) > 0 +func (f Filter) Add(key, val string) { + f[key] = append(f[key], val) } func (f Filter) ValueAt(val string, index int) string { @@ -84,7 +84,7 @@ func MakeFilterString(prefix string, filters Filter, validFilters []string) (res prefix += "." } - if !filters.IsNotEmpty() { + if filters.Count() == 0 { return "", true }