Golang archive/zip.Close() function usage example

package archive/zip

Close finishes writing the zip file by writing the central directory. It does not (and can not) close the underlying writer.

zip.Close() function usage example

 buffer : = new(bytes.Buffer)
 zipWriter := zip.NewWriter(buffer)

 err := zipWriter.Close()
 if err != nil {
 fmt.Println(err)
 }

Advertisement