externalsort: fix readAll EOF behaviour.
This commit is contained in:
parent
da1e79316c
commit
d3877a13e5
1 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,9 @@ func readAll(r LineReader) (lines []string, err error) {
|
||||||
l, err := r.ReadLine()
|
l, err := r.ReadLine()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, io.EOF) {
|
if errors.Is(err, io.EOF) {
|
||||||
|
if l != "" {
|
||||||
|
lines = append(lines, l)
|
||||||
|
}
|
||||||
return lines, nil
|
return lines, nil
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue