Skip to content

don't ignore the last "line" if it doesn't end in a newline

db48x requested to merge db48x/kommandant:last-read into master

When ReadString hits the end of the stream before it finds a newline character, it returns the available data plus io.EOF. Since we don't want to drop that last line, even though it's technically ill-formed, this patch changes it so that we ignore the EOF unless line is also empty. The stream will still be empty the next time we go around the loop, at which point ReadStream will return an empty string and the io.EOF error.

Merge request reports