Unify dialer implementations
Instead of having several dialer implementations, leave only one in `pkg/dialer` and call it from `pkg/ttrpcutil`, `runtime/v(1|2)/shim` which had their own Closes #3471. Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>
This commit is contained in:
@@ -19,21 +19,13 @@ package dialer
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
winio "github.com/Microsoft/go-winio"
|
||||
)
|
||||
|
||||
func isNoent(err error) bool {
|
||||
if err != nil {
|
||||
if oerr, ok := err.(*os.PathError); ok {
|
||||
if oerr.Err == syscall.ENOENT {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
return os.IsNotExist(err)
|
||||
}
|
||||
|
||||
func dialer(address string, timeout time.Duration) (net.Conn, error) {
|
||||
|
||||
Reference in New Issue
Block a user