Fix os.EINVAL -> os.ErrInvalid change.

This commit is contained in:
Alex Bramley 2012-05-14 22:51:01 +01:00
parent cb5001bb27
commit dbdc470c5c
1 changed files with 3 additions and 3 deletions

View File

@ -99,7 +99,7 @@ func (m *mockNetConn) ExpectNothing() {
// Implement net.Conn interface // Implement net.Conn interface
func (m *mockNetConn) Read(b []byte) (int, error) { func (m *mockNetConn) Read(b []byte) (int, error) {
if m.closed { if m.closed {
return 0, os.EINVAL return 0, os.ErrInvalid
} }
l := 0 l := 0
select { select {
@ -114,7 +114,7 @@ func (m *mockNetConn) Read(b []byte) (int, error) {
func (m *mockNetConn) Write(s []byte) (int, error) { func (m *mockNetConn) Write(s []byte) (int, error) {
if m.closed { if m.closed {
return 0, os.EINVAL return 0, os.ErrInvalid
} }
b := make([]byte, len(s)) b := make([]byte, len(s))
copy(b, s) copy(b, s)
@ -124,7 +124,7 @@ func (m *mockNetConn) Write(s []byte) (int, error) {
func (m *mockNetConn) Close() error { func (m *mockNetConn) Close() error {
if m.closed { if m.closed {
return os.EINVAL return os.ErrInvalid
} }
// Shut down *ALL* the goroutines! // Shut down *ALL* the goroutines!
// This will trigger an EOF event in Read() too // This will trigger an EOF event in Read() too