From 02e8aff16e653a6639ae0c91b566abd4a0129a4f Mon Sep 17 00:00:00 2001 From: Daniel Canter Date: Tue, 5 Apr 2022 18:07:44 -0700 Subject: [PATCH] Assign ErrPipeListenerClosed to net.ErrClosed This error used to just be a `errors.New` with the text exactly matching the "use of closed network connection" that you'd get from the Go stdlib. Now that that error was exported as `net.ErrClosed` in Go 1.16 we should be able to swap to this safely, and anyone who relied on checking the string explicitly should still be fine. Signed-off-by: Daniel Canter --- pipe.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pipe.go b/pipe.go index 58fa5f8..1acb201 100644 --- a/pipe.go +++ b/pipe.go @@ -89,8 +89,7 @@ const ( var ( // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed. - // This error should match net.errClosing since docker takes a dependency on its text. - ErrPipeListenerClosed = errors.New("use of closed network connection") + ErrPipeListenerClosed = net.ErrClosed errPipeWriteClosed = errors.New("pipe has been closed for write") )