From 27dc941b00f7293167408cdd97648cbadde0119b Mon Sep 17 00:00:00 2001 From: masa23 Date: Wed, 24 Jul 2019 14:12:47 +0900 Subject: [PATCH] =?UTF-8?q?README=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++++---- example/example.go | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9e110d7..853efee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# gotail +# gotail [![GoDoc](https://godoc.org/github.com/masa23/gotail?status.svg)](https://godoc.org/github.com/masa23/gotail) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE) + +gotail is Go library for reading data from realtime updating file , read like "tail -f" command. +See https://godoc.org/github.com/masa23/gotail for the API document. ## License MIT @@ -34,12 +37,14 @@ func main() { panic(err) } - tail.Scan() - for { - b := tail.TailString() + for tail.Scan() { + b := tail.Text() fmt.Println(b) } + if err = tail.Err(); err != nil { + panic(err) + } } ``` diff --git a/example/example.go b/example/example.go index 64d4123..88cb39a 100644 --- a/example/example.go +++ b/example/example.go @@ -41,7 +41,7 @@ func main() { fmt.Println(b) } - if tail.Err() != nil { + if err = tail.Err(); err != nil { panic(err) } }