fix: SA4001 for netDialer copy

This commit is contained in:
wwqgtxx 2023-03-10 16:17:43 +08:00
parent 7cc1c1b561
commit 2c4783ff8b

View file

@ -116,7 +116,8 @@ func dialContext(ctx context.Context, network string, destination netip.Addr, po
case nil:
netDialer = &net.Dialer{}
case *net.Dialer:
netDialer = &*netDialer.(*net.Dialer) // make a copy
_netDialer := *netDialer.(*net.Dialer)
netDialer = &_netDialer // make a copy
default:
return netDialer.DialContext(ctx, network, address)
}