Skip to content

Commit a4399e5

Browse files
committed
socket: deprecate DialPipe
This function was a wrapper for go-winio.DialPipe. Deprecate it in favor of using that package directly. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b071e04 commit a4399e5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

sockets/sockets.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ func ConfigureTransport(tr *http.Transport, proto, addr string) error {
4242
return nil
4343
}
4444

45+
// DialPipe connects to a Windows named pipe. It is not supported on
46+
// non-Windows platforms.
47+
//
48+
// Deprecated: use [github.com/Microsoft/go-winio.DialPipe] or [github.com/Microsoft/go-winio.DialPipeContext].
49+
func DialPipe(addr string, timeout time.Duration) (net.Conn, error) {
50+
return dialPipe(addr, timeout)
51+
}
52+
4553
func configureUnixTransport(tr *http.Transport, proto, addr string) error {
4654
if len(addr) > maxUnixSocketPathSize {
4755
return fmt.Errorf("unix socket path %q is too long", addr)

sockets/sockets_unix.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ func configureNpipeTransport(tr *http.Transport, proto, addr string) error {
1313
return ErrProtocolNotAvailable
1414
}
1515

16-
// DialPipe connects to a Windows named pipe.
17-
// This is not supported on other OSes.
18-
func DialPipe(_ string, _ time.Duration) (net.Conn, error) {
16+
func dialPipe(_ string, _ time.Duration) (net.Conn, error) {
1917
return nil, syscall.EAFNOSUPPORT
2018
}

sockets/sockets_windows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func configureNpipeTransport(tr *http.Transport, proto, addr string) error {
1818
return nil
1919
}
2020

21-
// DialPipe connects to a Windows named pipe.
22-
func DialPipe(addr string, timeout time.Duration) (net.Conn, error) {
21+
func dialPipe(addr string, timeout time.Duration) (net.Conn, error) {
2322
return winio.DialPipe(addr, &timeout)
2423
}

0 commit comments

Comments
 (0)