The reader that reads from the tail of the file line by line.
ex) periodically access the log file and read only newly added
bufferSize := 1024
reader, err := tailreader.New(file, bufferSize)
if err != nil {
// handle error
...
}
defer reader.Close()
for reader.HasNext() {
line, _ := reader.Read()
fmt.Println(line)
}
// if file content is below:
// aaa
// bbb
// ccc
//
// then this code prints below:
// ccc
// bbb
// aaa