mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
14 lines
283 B
Go
14 lines
283 B
Go
package underscore
|
|
|
|
type numbers interface {
|
|
int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64
|
|
}
|
|
|
|
func Contains[T numbers](values []T, value T) bool {
|
|
for _, v := range values {
|
|
if v == value {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|