I'm trying this out on Windows, and everything seems to be working out of the box except I'm getting a NUL character between every character that's printed out.
Here's the code:
t, err := tail.TailFile("foo", tail.Config{Follow: true, Logger: tail.DiscardingLogger})
if err != nil {
log.Fatal(err)
return
}
for line := range t.Lines {
fmt.Println(line.Text)
}
Found the problem.
I was testing it using the Windows command "echo 'abcd' >> tailing_file"
Windows seems to put in NULs when tail has the file open.
Appending to the file with another go program worked fine.
I'm trying this out on Windows, and everything seems to be working out of the box except I'm getting a NUL character between every character that's printed out.
Here's the code: t, err := tail.TailFile("foo", tail.Config{Follow: true, Logger: tail.DiscardingLogger}) if err != nil { log.Fatal(err) return } for line := range t.Lines { fmt.Println(line.Text) }
Any idea why this is happening?