The built-in package zip contains the NewWriter and NewReader functions to create the zip.Writer to compress, and the zip.Reader to decompress the zipped content.
Each record of the ZIP file is created with the Create method of the created zip.Writer . The returned Writer is then used to write the content body.
To decompress the files, the OpenReader function is used to create the ReadCloser of the records in the zipped file. The File field of the created ReaderCloser is the slice of zip.File pointers. The content of the file is obtained by calling the Open method and by reading the returned ReadCloser.