// zipReplace copies a file from one zip archive to another, preserving the
// metadata, replacing the content, and force-enabling compression.
zipReplace copies a file from one zip archive to another, preserving the
metadata, replacing the content, and force-enabling compression.
// zipReplace copies a file from one zip archive to another preserving the // metadata replacing the content and force - enabling compression .
func zipReplace(z *zip.Writer, f *zip.FileHeader, r io.Reader) error {
	w, err := z.CreateHeader(&zip.FileHeader{
		Name:          f.Name,
		Comment:       f.Comment,
		Method:        zip.Deflate,
		Modified:      f.Modified,
		ModifiedTime:  f.ModifiedTime,
		ModifiedDate:  f.ModifiedDate,
		Extra:         f.Extra,
		ExternalAttrs: f.ExternalAttrs,
	})
	if err != nil {
		return err
	}
	_, err = io.Copy(w, r)
	return err
}
func zipReplace ( z * zip . Writer , f * zip . FileHeader , r io . Reader ) error { w , err := z . CreateHeader ( & zip . FileHeader { Name : f . Name , Comment : f . Comment , Method : zip . Deflate , Modified : f . Modified , ModifiedTime : f . ModifiedTime , ModifiedDate : f . ModifiedDate , Extra : f . Extra , ExternalAttrs : f . ExternalAttrs , } ) if err != nil { return err } _ , err = io . Copy ( w , r ) return err }
zipReplace copies a file from one zip archive to another, preserving the
metadata, replacing the content, and force-enabling compression.
zipReplace copies a file from one zip archive to another preserving the metadata replacing the content and force - enabling compression .