ZIP compression is a widely used compression format. It is usual to use the ZIP format for an application to upload a file set or, on the other hand, export zipped files as output. This recipe will show you how to handle ZIP files programmatically with the use of the standard library.
Reading and writing ZIP files
How to do it...
- Open the console and create the folder chapter05/recipe11.
- Navigate to the directory.
- Create the zip.go file with the following content:
package main
import (
"archive/zip"
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
)
func main() {
...