code: func (w *writer) flushPart() error {
  	if len(w.readyPart) == 0 && len(w.pendingPart) == 0 {
  		// nothing to write
  		return nil
  	}
  	if len(w.pendingPart) < int(w.driver.ChunkSize) {
  		// closing with a small pending part
  		// combine ready and pending to avoid writing a small part
  		w.readyPart = append(w.readyPart, w.pendingPart...)
  		w.pendingPart = nil
  	}
  
  	partNumber := aws.Int64(int64(len(w.parts) + 1))
  	resp, err := w.driver.S3.UploadPart(&s3.UploadPartInput{
  		Bucket:     aws.String(w.driver.Bucket),
  		Key:        aws.String(w.key),
  		PartNumber: partNumber,
  		UploadId:   aws.String(w.uploadID),
  		Body:       bytes.NewReader(w.readyPart),
  	})
  	if err != nil {
  		return err
  	}
  	w.parts = append(w.parts, &s3.Part{
  		ETag:       resp.ETag,
  		PartNumber: partNumber,
  		Size:       aws.Int64(int64(len(w.readyPart))),
  	})
  	w.readyPart = w.pendingPart
  	w.pendingPart = nil
  	return nil
  }
docs: // flushPart flushes buffers to write a part to S3.
  // Only called by Write (with both buffers full) and Close/Commit (always)