code: func newWriter(reportFn func(report), layersChangedFn func(report, report) bool) io.WriteCloser {
  	writer := &imageProgressWriter{
  		mutex:                  &sync.Mutex{},
  		layerStatus:            map[string]*progressLine{},
  		reportFn:               reportFn,
  		layersChangedFn:        layersChangedFn,
  		progressTimeThreshhold: defaultProgressTimeThreshhold,
  		stableThreshhold:       defaultStableThreshhold,
  	}
  	return writer
  }
docs: // newWriter creates a writer that periodically reports
  // on pull/push progress of a Docker image. It only reports when the state of the
  // different layers has changed and uses time thresholds to limit the
  // rate of the reports.