mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
fix: dns empty response
This commit is contained in:
parent
ae518cce52
commit
bfd5da2f00
4 changed files with 22 additions and 3 deletions
|
@ -28,3 +28,20 @@ func Combine(maybeError ...error) error {
|
|||
}
|
||||
return errs
|
||||
}
|
||||
|
||||
func AllEqual(expected error, actual error) bool {
|
||||
switch errs := actual.(type) {
|
||||
case multiError:
|
||||
if len(errs) == 0 {
|
||||
return false
|
||||
}
|
||||
for _, err := range errs {
|
||||
if err != expected {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
default:
|
||||
return errs == expected
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue