Skip to content

Commit

Permalink
Fix missing io.EOF when concurency is disabled pkg#489
Browse files Browse the repository at this point in the history
  • Loading branch information
glebteterin committed Jan 19, 2022
1 parent 31aac3e commit dad2375
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)])

Expand Down

0 comments on commit dad2375

Please sign in to comment.