25 lines
462 B
Go
25 lines
462 B
Go
package control
|
|
|
|
import "github.com/yukimochi/Activity-Relay/models"
|
|
|
|
func contains(entries interface{}, finder string) bool {
|
|
switch entry := entries.(type) {
|
|
case string:
|
|
return entry == finder
|
|
case []string:
|
|
for i := 0; i < len(entry); i++ {
|
|
if entry[i] == finder {
|
|
return true
|
|
}
|
|
}
|
|
case []models.Subscription:
|
|
for i := 0; i < len(entry); i++ {
|
|
if entry[i].Domain == finder {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
return false
|
|
}
|