How can I use the “compress/gzip” package to gzip a file?

All the compress packages implement the same interface. You would use something like this to compress:

var b bytes.Buffer
w := gzip.NewWriter(&b)
w.Write([]byte("hello, world\n"))
w.Close()

And this to unpack:

r, err := gzip.NewReader(&b)
io.Copy(os.Stdout, r)
r.Close()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)