// NetDialerWithTCPKeepalive returns a net.Dialer that enables TCP keepalives on // the underlying connection with OS default values for keepalive parameters. // // TODO: Once https://github.com/golang/go/issues/62254 lands, and the // appropriate Go version becomes less than our least supported Go version, we // should look into using the new API to make things more straightforward. func NetDialerWithTCPKeepalive() *net.Dialer { … }