Skip to content

Latest commit

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Package progress - progress meters through a channel, wrapping an io.Reader

Build StatusGoDoc

Example:

funcprogress(reader io.Reader) {
r=NewReader("an_file.tar", reader, 100*time.Millisecond)
deferr.Close()
varcountuint64// This goroutine consumes the channel and concatenates the count to display// the total as it increases.gofunc(r*Reader) {
fortick:=ranger.C {
count+=tick.Valuefmt.Printf("\r%d", count)
}
fmt.Println()
}(r)
// use r like you normally would; progress will be reported to C every 100// milliseconds.if_, err:=io.Copy(ioutil.Discard, r); err!=nil {
panic(err)
}
}

Author

Erik Hollensbe github@hollensbe.org

About

Progress meter implemented as an io.Reader with channels

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages