code: func filterTarPipe(w *tar.Writer, r *tar.Reader, fn func(*tar.Header) bool) error {
  	for {
  		h, err := r.Next()
  		if err != nil {
  			return err
  		}
  		if fn(h) {
  			if err := w.WriteHeader(h); err != nil {
  				return err
  			}
  			if _, err := io.Copy(w, r); err != nil {
  				return err
  			}
  		} else {
  			if _, err := io.Copy(ioutil.Discard, r); err != nil {
  				return err
  			}
  		}
  	}
  }
docs: // filterTarPipe transforms a tar file as it is streamed, calling fn on each header in the file.
  // If fn returns false, the file is skipped. If an error occurs it is returned.