Skip to content

Commit

Permalink
Merge pull request #490 from glebteterin/bug-489
Browse files Browse the repository at this point in the history
Fix missing io.EOF when concurency is disabled #489
  • Loading branch information
puellanivis authored Jan 19, 2022
2 parents 31aac3e + dad2375 commit 7d25d53
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 7d25d53

Please sign in to comment.