Commit d06571d28037e08857feb04282620204542ad0a8
1 parent
dcfc404979
Exists in
master
filter.ValueAt()
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
filtering.go
... | ... | @@ -22,6 +22,16 @@ func (f Filter) IsNotEmpty() bool { |
22 | 22 | return len(f) > 0 |
23 | 23 | } |
24 | 24 | |
25 | +func (f Filter) ValueAt(val string, index int) string { | |
26 | + if filter, ok := f[val]; ok { | |
27 | + if len(filter) > index { | |
28 | + return filter[index] | |
29 | + } | |
30 | + } | |
31 | + | |
32 | + return "" | |
33 | +} | |
34 | + | |
25 | 35 | func (fs Filter) validate(validFilters []string) (Filter, bool) { |
26 | 36 | goodFilters := make(Filter) |
27 | 37 | cnt, len := 0, 0 | ... | ... |