Documentation
¶
Overview ¶
Package progress provides an io.Writer that prints number of written bytes to stdout in a pretty way.
Use io.MultiWriter to chain it together with you destination writer like this:
f, err := os.Open(...) ... fi, err := f.Stat() ... n, err := io.Copy(io.MultiWriter(dst, progress.New(fi.Size())), src)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
Total int64 // total number of bytes to be written, if known
Output io.Writer // progress is written here, os.Stout by default
// contains filtered or unexported fields
}
Writer on each Write call prints a progress info to os.Stdout. Progress format is "sum/total" ending with carriage return, so if os.Stdout is attached to a terminal output would update the same line over and over.
Click to show internal directories.
Click to hide internal directories.