mirror of
https://github.com/rclone/rclone.git
synced 2024-11-28 03:14:55 +01:00
42 lines
854 B
Go
42 lines
854 B
Go
package check
|
|
|
|
// StringSliceContains iterates over the slice to find the target.
|
|
func StringSliceContains(slice []string, target string) bool {
|
|
for _, v := range slice {
|
|
if v == target {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// IntSliceContains iterates over the slice to find the target.
|
|
func IntSliceContains(slice []int, target int) bool {
|
|
for _, v := range slice {
|
|
if v == target {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Int32SliceContains iterates over the slice to find the target.
|
|
func Int32SliceContains(slice []int32, target int32) bool {
|
|
for _, v := range slice {
|
|
if v == target {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Int64SliceContains iterates over the slice to find the target.
|
|
func Int64SliceContains(slice []int64, target int64) bool {
|
|
for _, v := range slice {
|
|
if v == target {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|