fix: golang1.19 can't compile

This commit is contained in:
wwqgtxx
2023-02-26 22:20:25 +08:00
parent d36f9c2ac8
commit c8c078e78a
4 changed files with 24 additions and 8 deletions

18
component/dialer/error.go Normal file
View File

@ -0,0 +1,18 @@
package dialer
import (
"errors"
E "github.com/sagernet/sing/common/exceptions"
)
var (
ErrorNoIpAddress = errors.New("no ip address")
ErrorInvalidedNetworkStack = errors.New("invalided network stack")
)
func errorsJoin(errs ...error) error {
// compatibility with golang<1.20
// maybe use errors.Join(errs...) is better after we drop the old version's support
return E.Errors(errs...)
}