mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 12:57:38 +03:00
Rename mutli error unwrap method
This commit is contained in:
parent
7def9588a5
commit
e839483670
2 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ func (e *multiError) Error() string {
|
|||
return strings.Join(F.MapToString(e.errors), " | ")
|
||||
}
|
||||
|
||||
func (e *multiError) UnwrapMulti() []error {
|
||||
func (e *multiError) Unwrap() []error {
|
||||
return e.errors
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ func Errors(errors ...error) error {
|
|||
|
||||
func Expand(err error) []error {
|
||||
if multiErr, isMultiErr := err.(MultiError); isMultiErr {
|
||||
return ExpandAll(multiErr.UnwrapMulti())
|
||||
return ExpandAll(multiErr.Unwrap())
|
||||
}
|
||||
return []error{err}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ func IsMulti(err error, targetList ...error) bool {
|
|||
if !isMulti {
|
||||
return false
|
||||
}
|
||||
return common.All(multiErr.UnwrapMulti(), func(it error) bool {
|
||||
return common.All(multiErr.Unwrap(), func(it error) bool {
|
||||
return IsMulti(it, targetList...)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue