chore: update to go1.21rc2, drop support for go1.19

This commit is contained in:
wwqgtxx
2023-07-02 09:59:18 +08:00
parent c6b84b0f20
commit 8f1475d5d0
18 changed files with 47 additions and 118 deletions

View File

@ -2,6 +2,7 @@ package dialer
import (
"context"
"errors"
"fmt"
"net"
"net/netip"
@ -207,7 +208,7 @@ func dualStackDialContext(ctx context.Context, dialFn dialFunc, network string,
if fallback.error == nil && fallback.Conn != nil {
return fallback.Conn, nil
}
return nil, errorsJoin(errs...)
return nil, errors.Join(errs...)
}
func parallelDialContext(ctx context.Context, network string, ips []netip.Addr, port string, opt *option) (net.Conn, error) {
@ -244,7 +245,7 @@ func parallelDialContext(ctx context.Context, network string, ips []netip.Addr,
}
if len(errs) > 0 {
return nil, errorsJoin(errs...)
return nil, errors.Join(errs...)
}
return nil, os.ErrDeadlineExceeded
}
@ -261,7 +262,7 @@ func serialDialContext(ctx context.Context, network string, ips []netip.Addr, po
errs = append(errs, err)
}
}
return nil, errorsJoin(errs...)
return nil, errors.Join(errs...)
}
type dialResult struct {