Skip to content

jbardin/readchan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 30, 2018
d83bfe7 · Jan 30, 2018

History

12 Commits
Mar 7, 2016
Feb 23, 2016
Jan 28, 2018
Jan 30, 2018
Jan 30, 2018

Repository files navigation

readchan

GoDoc

Package readchan provides methods for iterating over an io.Reader by block or line, and reading the results via a channel.

f, err := os.Open("file.txt")
if err != nil {
  log.Fatal(err)
}

for line := range readchan.Lines(context.TODO(), f, 1) {
  if line.Err != nil {
    log.Fatal(err)
  }
  fmt.Printf("LINE: %q\n", line.Data)
  line.Done()
}

About

Read files via a channel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages