code: func FilterArchive(r io.Reader, w io.Writer, fn TransformFileFunc) error {
  	tr := tar.NewReader(r)
  	tw := tar.NewWriter(w)
  
  	for {
  		h, err := tr.Next()
  		if err == io.EOF {
  			return tw.Close()
  		}
  		if err != nil {
  			return err
  		}
  
  		var body io.Reader = tr
  		name := h.Name
  		data, ok, skip, err := fn(h, tr)
  		glog.V(6).Infof("Transform %s -> %s: data=%t ok=%t skip=%t err=%v", name, h.Name, data != nil, ok, skip, err)
  		if err != nil {
  			return err
  		}
  		if skip {
  			continue
  		}
  		if ok {
  			h.Size = int64(len(data))
  			body = bytes.NewBuffer(data)
  		}
  		if err := tw.WriteHeader(h); err != nil {
  			return err
  		}
  		if _, err := io.Copy(tw, body); err != nil {
  			return err
  		}
  	}
  }
docs: // FilterArchive transforms the provided input archive to a new archive,
  // giving the fn a chance to transform arbitrary files.