0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-12 03:19:36 +03:00

fix: dns empty response

This commit is contained in:
Zeyu Chen
2023-04-26 22:35:12 +08:00
committed by yuhan6665
parent ae518cce52
commit bfd5da2f00
4 changed files with 22 additions and 3 deletions

View File

@ -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
}
}