From 506fdadaa6fb06aa21d8b0c02aa8a6366337aa51 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 2 Oct 2022 14:52:02 +0100 Subject: Use signal values from syscall There is no change in API or behavior. --- pipeln.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'pipeln.go') diff --git a/pipeln.go b/pipeln.go index a05a473..ca130e2 100644 --- a/pipeln.go +++ b/pipeln.go @@ -5,8 +5,7 @@ package pipeln import ( "context" "net" - - "golang.org/x/sys/unix" + "syscall" ) // PipeListenerDialer can be used to simulate client-server interaction @@ -26,7 +25,7 @@ func (ln *PipeListenerDialer) Accept() (net.Conn, error) { case conn := <-ln.conns: return conn, nil case <-ln.done: - return nil, unix.EINVAL + return nil, syscall.EINVAL } } @@ -38,7 +37,7 @@ func (ln *PipeListenerDialer) Addr() net.Addr { // See net.Listener.Close for more details. func (ln *PipeListenerDialer) Close() error { if !ln.ok { - return unix.EINVAL + return syscall.EINVAL } close(ln.done) ln.ok = false @@ -53,14 +52,14 @@ func (ln *PipeListenerDialer) Dial(_, addr string) (net.Conn, error) { // DialContext is a dummy wrapper around Dial. func (ln *PipeListenerDialer) DialContext(ctx context.Context, _, addr string) (net.Conn, error) { if addr != ln.addr { - return nil, unix.EINVAL + return nil, syscall.EINVAL } s, c := net.Pipe() select { case ln.conns <- s: return c, nil case <-ln.done: - return nil, unix.ECONNREFUSED + return nil, syscall.ECONNREFUSED case <-ctx.Done(): return nil, ctx.Err() } -- cgit v1.2.3-70-g09d2