(ctx context.Context, network, addr string)
| 34 | } |
| 35 | |
| 36 | func Dial(ctx context.Context, network, addr string) (net.Conn, error) { |
| 37 | var d net.Dialer |
| 38 | switch network { |
| 39 | case "unix": |
| 40 | if err := validateSocketPath(addr); err != nil { |
| 41 | return nil, err |
| 42 | } |
| 43 | return d.DialContext(ctx, "unix", addr) |
| 44 | case "npipe": |
| 45 | // N.B. this will return an error on non-Windows |
| 46 | return dialNamedPipe(ctx, addr) |
| 47 | default: |
| 48 | return nil, fmt.Errorf("unsupported network: %s", network) |
| 49 | } |
| 50 | } |
no test coverage detected