mirror of
https://github.com/pyihe/go-pkg.git
synced 2025-10-07 17:00:51 +08:00
refactor(errors): change errors
This commit is contained in:
@@ -54,7 +54,7 @@ func Notify(onNotify func()) {
|
||||
// Contain 判断src中是否有元素ele
|
||||
func Contain(src interface{}, ele interface{}) bool {
|
||||
switch reflect.TypeOf(src).Kind() {
|
||||
case reflect.Slice:
|
||||
case reflect.Slice, reflect.Array:
|
||||
s := reflect.ValueOf(src)
|
||||
for i := 0; i < s.Len(); i++ {
|
||||
if reflect.DeepEqual(ele, s.Index(i).Interface()) {
|
||||
|
Reference in New Issue
Block a user