externalsort: fix readAll EOF behaviour.

This commit is contained in:
Arseny Balobanov 2020-03-14 22:19:37 +03:00
parent da1e79316c
commit d3877a13e5

View file

@ -21,6 +21,9 @@ func readAll(r LineReader) (lines []string, err error) {
l, err := r.ReadLine()
if err != nil {
if errors.Is(err, io.EOF) {
if l != "" {
lines = append(lines, l)
}
return lines, nil
}
return nil, err