1 Star 0 Fork 0

bughou / go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
contains.go 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
bughou 提交于 2022-03-20 18:50 . save
package slice
import "reflect"
func Contains(length int, fun func(int) bool) bool {
return Index(length, fun) >= 0
}
func ContainsGeneric(slice interface{}, target interface{}) bool {
return IndexGeneric(slice, target) >= 0
}
func ContainsValue(slice reflect.Value, target interface{}) bool {
return IndexValue(slice, target) >= 0
}
func ContainsInterface(slice []interface{}, target interface{}) bool {
return IndexInterface(slice, target) >= 0
}
func ContainsString(slice []string, target string) bool {
return IndexString(slice, target) >= 0
}
func ContainsBool(slice []bool, target bool) bool {
return IndexBool(slice, target) >= 0
}
func ContainsInt(slice []int, target int) bool {
return IndexInt(slice, target) >= 0
}
func ContainsInt8(slice []int8, target int8) bool {
return IndexInt8(slice, target) >= 0
}
func ContainsInt16(slice []int16, target int16) bool {
return IndexInt16(slice, target) >= 0
}
func ContainsInt32(slice []int32, target int32) bool {
return IndexInt32(slice, target) >= 0
}
func ContainsInt64(slice []int64, target int64) bool {
return IndexInt64(slice, target) >= 0
}
func ContainsUint(slice []uint, target uint) bool {
return IndexUint(slice, target) >= 0
}
func ContainsUint8(slice []uint8, target uint8) bool {
return IndexUint8(slice, target) >= 0
}
func ContainsUint16(slice []uint16, target uint16) bool {
return IndexUint16(slice, target) >= 0
}
func ContainsUint32(slice []uint32, target uint32) bool {
return IndexUint32(slice, target) >= 0
}
func ContainsUint64(slice []uint64, target uint64) bool {
return IndexUint64(slice, target) >= 0
}
Go
1
https://gitee.com/bughou/go.git
git@gitee.com:bughou/go.git
bughou
go
go
d31700df43a9

搜索帮助