// GzipCompress compresses the given content with gzip and returns a base64-encoded string.
GzipCompress compresses the given content with gzip and returns a base64-encoded string.
// GzipCompress compresses the given content with gzip and returns a base64 - encoded string .
func GzipCompress(docBytes []byte) (string, error) {
	var buf bytes.Buffer
	zw := gzip.NewWriter(&buf)
	if _, err := zw.Write(docBytes); err != nil {
		return "", fmt.Errorf("gzip compress: %w", err)
	}
	if err := zw.Close(); err != nil {
		return "", fmt.Errorf("close gzip writer: %w", err)
	}
	return base64.StdEncoding.EncodeToString(buf.Bytes()), nil
}
func GzipCompress ( docBytes [ ] byte ) ( string , error ) { var buf bytes . Buffer zw := gzip . NewWriter ( & buf ) if _ , err := zw . Write ( docBytes ) ; err != nil { return " " , fmt . Errorf ( " " , err ) } if err := zw . Close ( ) ; err != nil { return " " , fmt . Errorf ( " " , err ) } return base64 . StdEncoding . EncodeToString ( buf . Bytes ( ) ) , nil }
GzipCompress compresses the given content with gzip and returns a base64-encoded string.
GzipCompress compresses the given content with gzip and returns a base64 - encoded string .