From dad23755af9bbf8fba357c0c89e672305dfe96e3 Mon Sep 17 00:00:00 2001 From: Gleb Teterin Date: Thu, 20 Jan 2022 07:55:11 +1300 Subject: [PATCH] Fix missing io.EOF when concurency is disabled #489 --- client.go | 3 --- client_integration_test.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/client.go b/client.go index 8894053f..1587eb83 100644 --- a/client.go +++ b/client.go @@ -999,9 +999,6 @@ func (f *File) readAtSequential(b []byte, off int64) (read int, err error) { read += n } if err != nil { - if errors.Is(err, io.EOF) { - return read, nil // return nil explicitly. - } return read, err } } diff --git a/client_integration_test.go b/client_integration_test.go index 03e0badb..f26adb44 100644 --- a/client_integration_test.go +++ b/client_integration_test.go @@ -1203,7 +1203,7 @@ func TestClientReadSequential(t *testing.T) { stuff := make([]byte, 32) n, err := sftpFile.Read(stuff) - require.NoError(t, err) + require.ErrorIs(t, err, io.EOF) require.Equal(t, len(content), n) require.Equal(t, content, stuff[0:len(content)])