shared/ioprogress/reader.go
func (pt *ProgressReader) Read(p []byte) (int, error) {
	// Do normal reader tasks
	n, err := pt.ReadCloser.Read(p)

	// Do the actual progress tracking
	if pt.Tracker != nil {
		pt.Tracker.total += int64(n)
		pt.Tracker.update(n)
	}

	return n, err
}
func (pt *ProgressReader) Read(p []byte) (int, error) {
	// Do normal reader tasks
	n, err := pt.ReadCloser.Read(p)

	// Do the actual progress tracking
	if pt.Tracker != nil {
		pt.Tracker.total += int64(n)
		pt.Tracker.update(n)
	}

	return n, err
}
func ( pt * ProgressReader ) Read ( p [ ] byte ) ( int , error ) { // Do normal reader tasks n , err := pt . ReadCloser . Read ( p ) // Do the actual progress tracking if pt . Tracker != nil { pt . Tracker . total += int64 ( n ) pt . Tracker . update ( n ) } return n , err }
// Read in ProgressReader is the same as io.Read
Read in ProgressReader is the same as io . Read