Merge pull request #55 from genexpr/cherry-pick-filter

Add filter helper method
This commit is contained in:
Max Sokolovsky 2022-01-07 13:23:23 -05:00 committed by GitHub
commit a73b7d7f4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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