feat: Enable immediate dial termination by reusing passed context in GetResolver (#1006)

This commit is contained in:
frank 2024-01-15 22:42:02 +08:00 committed by GitHub
parent faf046e059
commit 0723ff9282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ func GetResolver(ctx context.Context, nameserver string) *net.Resolver {
return &net.Resolver{
PreferGo: true,
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
Dial: func(_ context.Context, network, address string) (net.Conn, error) {
d := net.Dialer{}
return d.DialContext(ctx, network, net.JoinHostPort(nameserver, "53"))
},