Golang archive/zip.ReadCloser.Close() function usage example

package archive/zip

Close closes the Zip file, rendering it unusable for I/O.

zip.ReadCloser.Close() usage example

 read, err := zip.OpenReader(“files.zip”)
 if err != nil {
 fmt.Println(err)
 }
 defer read.Close()  // close the ReadCloser

Advertisement