mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
make metrics tests pass on windows
Signed-off-by: guillaume.tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
9ad06e55b5
commit
886363b44a
@ -20,6 +20,7 @@ package metrics
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Microsoft/go-winio"
|
"github.com/Microsoft/go-winio"
|
||||||
@ -30,6 +31,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func conn() (net.Conn, error) {
|
func conn() (net.Conn, error) {
|
||||||
|
if strings.HasPrefix(socket, `\\.\pipe\`) {
|
||||||
timeout := 200 * time.Millisecond
|
timeout := 200 * time.Millisecond
|
||||||
return winio.DialPipe(socket, &timeout)
|
return winio.DialPipe(socket, &timeout)
|
||||||
}
|
}
|
||||||
|
return net.Dial("unix", socket)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user