mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
15 lines
216 B
Go
15 lines
216 B
Go
package errorx
|
|
|
|
import "errors"
|
|
|
|
// In checks if the given err is one of errs.
|
|
func In(err error, errs ...error) bool {
|
|
for _, each := range errs {
|
|
if errors.Is(err, each) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|