shared/ioprogress/writer.go
func (pt *ProgressWriter) Write(p []byte) (int, error) {
	// Do normal writer tasks
	n, err := pt.WriteCloser.Write(p)

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

	return n, err
}
func (pt *ProgressWriter) Write(p []byte) (int, error) {
	// Do normal writer tasks
	n, err := pt.WriteCloser.Write(p)

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

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