From bd388db1cc82cc88a8dd2ae037f38a64a13f3fcb Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Tue, 23 Aug 2011 10:43:48 +0100 Subject: [PATCH] MockNetConn: Use correct os.Errors in Read/Write. --- client/mocknetconn_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mocknetconn_test.go b/client/mocknetconn_test.go index c6fd812..5a34140 100644 --- a/client/mocknetconn_test.go +++ b/client/mocknetconn_test.go @@ -91,7 +91,7 @@ func (m *mockNetConn) Expect(e string) { // Implement net.Conn interface func (m *mockNetConn) Read(b []byte) (int, os.Error) { if m.closed { - return 0, os.NewError("EOF") + return 0, os.EINVAL } select { case s := <-m.in: @@ -104,7 +104,7 @@ func (m *mockNetConn) Read(b []byte) (int, os.Error) { func (m *mockNetConn) Write(s []byte) (int, os.Error) { if m.closed { - return 0, os.NewError("Can't write to closed socket.") + return 0, os.EINVAL } b := make([]byte, len(s)) copy(b, s)