Add filter helper method

(cherry picked from commit 9b1b7d3132)
This commit is contained in:
Darren Shepherd 2020-11-09 21:52:17 -07:00 committed by Max Sokolovsky
parent 7d99790dba
commit b0dbb8fd60

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
}
}