https://github.com/mitchellh/ioprogress
Go (golang) package for progress bars around io.Reader/Writers.
https://github.com/mitchellh/ioprogress
Last synced: 3 months ago
JSON representation
Go (golang) package for progress bars around io.Reader/Writers.
- Host: GitHub
- URL: https://github.com/mitchellh/ioprogress
- Owner: mitchellh
- License: mit
- Archived: true
- Created: 2014-12-06T22:04:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-10-30T02:37:19.000Z (over 3 years ago)
- Last Synced: 2025-04-01T16:06:05.604Z (4 months ago)
- Language: Go
- Homepage: https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc
- Size: 9.77 KB
- Stars: 501
- Watchers: 11
- Forks: 33
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - mitchellh/ioprogress - Go (golang) package for progress bars around io.Reader/Writers. (Go)
README
# ioprogress
ioprogress is a Go (golang) library with implementations of `io.Reader`
and `io.Writer` that draws progress bars. The primary use case for these
are for CLI applications but alternate progress bar writers can be supplied
for alternate environments.## Example

## Installation
Standard `go get`:
```
$ go get github.com/mitchellh/ioprogress
```## Usage
Here is an example of outputting a basic progress bar to the CLI as
we're "downloading" from some other `io.Reader` (perhaps from a network
connection):```go
// Imagine this came from some external source, such as a network connection,
// and that we have the full size of it, such as from a Content-Length HTTP
// header.
var r io.Reader// Create the progress reader
progressR := &ioprogress.Reader{
Reader: r,
Size: rSize,
}// Copy all of the reader to some local file f. As it copies, the
// progressR will write progress to the terminal on os.Stdout. This is
// customizable.
io.Copy(f, progressR)
```