func GunzipReadCloser(r io.ReadCloser) (io.ReadCloser, error) {
	gr, err := gzip.NewReader(r)
	if err != nil {
		return nil, err
	}
	return &readAndCloser{
		Reader: gr,
		CloseFunc: func() error {
			if err := gr.Close(); err != nil {
				return err
			}
			return r.Close()
		},
	}, nil
}
GunzipReadCloser reads compressed input data from the io.ReadCloser and
returns an io.ReadCloser from which uncompessed data may be read.
package v1util
import (
	"bytes"
	"compress/gzip"
	"io"
)
var gzipMagicHeader = []byte{'\x1f', '\x8b'}
func GzipReadCloser(r io.ReadCloser) (io.ReadCloser, error) {
	return GzipReadCloserLevel(r, gzip.BestSpeed)
}
func GzipReadCloserLevel(r io.ReadCloser, level int) (io.ReadCloser, error) {
	pr, pw := io.Pipe()
	go func() {
		defer pw.Close()
		defer r.Close()
		gw, _ := gzip.NewWriterLevel(pw, level)
		defer gw.Close()
		_, err := io.Copy(gw, r)
		if err != nil {
			pr.CloseWithError(err)
		}
	}()
	return pr, nil
}