package file import ( "fmt" "testing" ) func TestFileStreamer(t *testing.T) { fStreamer, err := NewStreamer("/tmp/test.log", false) if err != nil { t.Fatal(err) } var line string var ok bool for { line, ok = <-fStreamer.Lines if !ok { t.Fatal("readline err") } fmt.Println(line) } fStreamer.Close() }