CreateZipWriter creates a zip writer for the given writer with a file header.
(zipw *zip.Writer, filename string, password string)
| 36 | |
| 37 | // CreateZipWriter creates a zip writer for the given writer with a file header. |
| 38 | func CreateZipWriter(zipw *zip.Writer, filename string, password string) (io.Writer, error) { |
| 39 | fh := CreateZipFileHeader(filename, password) |
| 40 | writer, err := zipw.CreateHeader(fh) |
| 41 | if err != nil { |
| 42 | return nil, errors.Wrapf(err, "failed to create zip entry for %s", filename) |
| 43 | } |
| 44 | return writer, nil |
| 45 | } |
| 46 | |
| 47 | // timeToMsDosTime converts a time.Time to an MS-DOS date and time. |
| 48 | // This is a modified copy for github.com/alexmullins/zip/struct.go because the package has a bug, |
no test coverage detected