From 136cda4961305ff120af46ab0b62439d1416c599 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 16 May 2014 18:06:11 -0700 Subject: [PATCH] process line even if it doesn't end in newline especially as we use ReadString now --- tail.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tail.go b/tail.go index 89a9474..87debed 100644 --- a/tail.go +++ b/tail.go @@ -213,7 +213,8 @@ func (tail *Tail) tailFileSync() { for { line, err := tail.readLine() - if err == nil { + // Process `line` even if err is EOF. + if err == nil || (err == io.EOF && line != "") { cooloff := !tail.sendLine(line) if cooloff { // Wait a second before seeking till the end of