From d06571d28037e08857feb04282620204542ad0a8 Mon Sep 17 00:00:00 2001 From: "marko.tikvic" Date: Fri, 21 Dec 2018 09:35:27 +0100 Subject: [PATCH] filter.ValueAt() --- filtering.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/filtering.go b/filtering.go index a56a4f9..e7a7c6e 100644 --- a/filtering.go +++ b/filtering.go @@ -22,6 +22,16 @@ func (f Filter) IsNotEmpty() bool { return len(f) > 0 } +func (f Filter) ValueAt(val string, index int) string { + if filter, ok := f[val]; ok { + if len(filter) > index { + return filter[index] + } + } + + return "" +} + func (fs Filter) validate(validFilters []string) (Filter, bool) { goodFilters := make(Filter) cnt, len := 0, 0 -- 1.8.1.2