diff --git a/v1/errors_windows.go b/v1/errors_windows.go index cb581c9..a726d91 100644 --- a/v1/errors_windows.go +++ b/v1/errors_windows.go @@ -9,9 +9,8 @@ import ( // isConnCloseError returns true if the error is from the peer closing the // connection early. func isConnCloseError(err error) bool { - const WSAEPROTOTYPE = syscall.Errno(10041) return errors.Is(err, io.EOF) || - errors.Is(err, WSAEPROTOTYPE) || + errors.Is(err, syscall.Errno(10041)) || // WSAEPROTOTYPE errors.Is(err, syscall.WSAECONNABORTED) || errors.Is(err, syscall.WSAECONNRESET) } diff --git a/v2/errors_windows.go b/v2/errors_windows.go index cb581c9..a726d91 100644 --- a/v2/errors_windows.go +++ b/v2/errors_windows.go @@ -9,9 +9,8 @@ import ( // isConnCloseError returns true if the error is from the peer closing the // connection early. func isConnCloseError(err error) bool { - const WSAEPROTOTYPE = syscall.Errno(10041) return errors.Is(err, io.EOF) || - errors.Is(err, WSAEPROTOTYPE) || + errors.Is(err, syscall.Errno(10041)) || // WSAEPROTOTYPE errors.Is(err, syscall.WSAECONNABORTED) || errors.Is(err, syscall.WSAECONNRESET) }