process line even if it doesn't end in newline
especially as we use ReadString now
This commit is contained in:
parent
941cc3e301
commit
136cda4961
3
tail.go
3
tail.go
|
@ -213,7 +213,8 @@ func (tail *Tail) tailFileSync() {
|
||||||
for {
|
for {
|
||||||
line, err := tail.readLine()
|
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)
|
cooloff := !tail.sendLine(line)
|
||||||
if cooloff {
|
if cooloff {
|
||||||
// Wait a second before seeking till the end of
|
// Wait a second before seeking till the end of
|
||||||
|
|
Loading…
Reference in New Issue