code: func (z *ZipArchive) Flush() error {
  	if !z.isHasChanged || (z.ReadCloser == nil && !z.isHasWriter) {
  		return nil
  	}
  
  	// Extract to tmp path and pack back.
  	tmpPath := path.Join(os.TempDir(), "cae", path.Base(z.FileName))
  	os.RemoveAll(tmpPath)
  	defer os.RemoveAll(tmpPath)
  
  	for _, f := range z.files {
  		if strings.HasSuffix(f.Name, "/") {
  			os.MkdirAll(path.Join(tmpPath, f.Name), os.ModePerm)
  			continue
  		}
  
  		// Relative path inside zip temporary changed.
  		f.tmpPath = path.Join(tmpPath, f.Name)
  		if err := z.extractFile(f); err != nil {
  			return err
  		}
  	}
  
  	if z.isHasWriter {
  		return packToWriter(tmpPath, z.writer, defaultPackFunc, true)
  	}
  
  	if err := PackTo(tmpPath, z.FileName); err != nil {
  		return err
  	}
  	return z.Open(z.FileName, os.O_RDWR|os.O_TRUNC, z.Permission)
  }
docs: // Flush saves changes to original zip file if any.