33 строки
544 Б
Go
33 строки
544 Б
Go
package filter
|
|
|
|
import (
|
|
"my/ktgo/pkg/storage"
|
|
"strings"
|
|
)
|
|
|
|
func IsListed(lists *[]*storage.Storage, s string) bool {
|
|
for _, list := range *lists {
|
|
if isListedInList(list, s) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func isListedInList(list *storage.Storage, in string) bool {
|
|
in_low := strings.ToLower(in)
|
|
for _, b := range *list.GetList() {
|
|
b = strings.ToLower(b)
|
|
if strings.Contains(in_low, b) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
for _, b := range *list.GetListCase() {
|
|
if strings.Contains(in, b) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|