Files
jx-callback/business/util/Contain.go

16 lines
294 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package util
import (
"errors"
)
// 判断obj是否在target中target支持的类型arrary,slice
func ContainForInt64Arry(obj int64, target []int64) (bool, error) {
for _, value := range target {
if value == obj {
return true, nil
}
}
return false, errors.New("not in array")
}