Create adds a file to the zip file using the provided name. It returns a [Writer] to which the file contents should be written. The file contents will be compressed using the [Deflate] method. The name must be a relative path: it must not start with a drive letter (e.g. C:) or leading slash, and onl
(name string)
| 217 | // The file's contents must be written to the [io.Writer] before the next |
| 218 | // call to [Writer.Create], [Writer.CreateHeader], or [Writer.Close]. |
| 219 | func (w *Writer) Create(name string) (io.Writer, error) { |
| 220 | header := &FileHeader{ |
| 221 | Name: name, |
| 222 | Method: Deflate, |
| 223 | } |
| 224 | return w.CreateHeader(header) |
| 225 | } |
| 226 | |
| 227 | // detectUTF8 reports whether s is a valid UTF-8 string, and whether the string |
| 228 | // must be considered UTF-8 encoding (i.e., not compatible with CP-437, ASCII, |