HasAnyStrings checks if a string slice contains any string from the query string slice
(queries []string, list []string)
| 35 | |
| 36 | // HasAnyStrings checks if a string slice contains any string from the query string slice |
| 37 | func HasAnyStrings(queries []string, list []string) bool { |
| 38 | keys := strset.New() |
| 39 | for _, elem := range queries { |
| 40 | keys.Add(elem) |
| 41 | } |
| 42 | for _, elem := range list { |
| 43 | if keys.Has(elem) { |
| 44 | return true |
| 45 | } |
| 46 | } |
| 47 | return false |
| 48 | } |
| 49 | |
| 50 | // HasAllStrings checks if a string slice contains all the strings from the query string slice |
| 51 | func HasAllStrings(queries []string, list []string) bool { |