From 50d779833e4457f5a2bed788d4048939db8e9fe7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 20 May 2021 17:56:36 +0200 Subject: rwcancel: use ordinary os.ErrClosed instead of custom error Signed-off-by: Jason A. Donenfeld --- rwcancel/rwcancel.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rwcancel/rwcancel.go b/rwcancel/rwcancel.go index 05484e1..5dff446 100644 --- a/rwcancel/rwcancel.go +++ b/rwcancel/rwcancel.go @@ -89,7 +89,7 @@ func (rw *RWCancel) Read(p []byte) (n int, err error) { return n, err } if !rw.ReadyRead() { - return 0, errors.New("fd closed") + return 0, os.ErrClosed } } } @@ -101,7 +101,7 @@ func (rw *RWCancel) Write(p []byte) (n int, err error) { return n, err } if !rw.ReadyWrite() { - return 0, errors.New("fd closed") + return 0, os.ErrClosed } } } -- cgit v1.2.3