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:
Kiril Vladimiroff
2019-11-07 14:47:17 +02:00
parent 640ca7812f
commit 4dd75be2b9
6 changed files with 7 additions and 101 deletions

View File

@@ -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) {