From d3877a13e5da52d1418e78d61cb4cd20d3e482f8 Mon Sep 17 00:00:00 2001 From: Arseny Balobanov Date: Sat, 14 Mar 2020 22:19:37 +0300 Subject: [PATCH] externalsort: fix readAll EOF behaviour. --- externalsort/io_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/externalsort/io_test.go b/externalsort/io_test.go index 129677f..c4bb5f6 100644 --- a/externalsort/io_test.go +++ b/externalsort/io_test.go @@ -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