Add filter helper method

This commit is contained in:
Darren Shepherd 2020-11-09 21:52:17 -07:00
parent 85f32491cb
commit 9b1b7d3132

12
filter.go Normal file
View File

@ -0,0 +1,12 @@
package dynamiclistener
func OnlyAllow(str string) func(...string) []string {
return func(s2 ...string) []string {
for _, s := range s2 {
if s == str {
return []string{s}
}
}
return nil
}
}