games-screenshot-manager/pkg/helpers/slice.go

14 lines
257 B
Go
Raw Normal View History

2020-10-29 12:50:27 +00:00
package helpers
func SliceContainsString(slice []string, s string, modifier func(s string) string) bool {
for _, item := range slice {
if item == s {
return true
}
if modifier != nil && modifier(item) == s {
return true
}
}
return false
}