EdgexAgent/device-ble-go/vendor/github.com/zeebo/errs/is_go_other.go
2025-07-10 20:40:32 +08:00

18 lines
339 B
Go

//go:build !go1.20
// +build !go1.20
package errs
// Is checks if any of the underlying errors matches target
func Is(err, target error) bool {
return IsFunc(err, func(err error) bool {
if err == target {
return true
}
if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) {
return true
}
return false
})
}