func NewResponseFilterWriter(filters []ResponseFilter, gz *gzipResponseWriter) *ResponseFilterWriter {
	return &ResponseFilterWriter{filters: filters, gzipResponseWriter: gz}
}
NewResponseFilterWriter creates and initializes a new ResponseFilterWriter.
package gzip
import (
	"compress/gzip"
	"net/http"
	"strconv"
)
type ResponseFilter interface {
	ShouldCompress(http.ResponseWriter) bool
}
type LengthFilter int64
func (l LengthFilter) ShouldCompress(w http.ResponseWriter) bool {
	contentLength := w.Header().Get("Content-Length")
	length, err := strconv.ParseInt(contentLength, 10, 64)
	if err != nil || length == 0 {
		return false
	}
	return l != 0 && int64(l) <= length
}
type SkipCompressedFilter struct{}
func (n SkipCompressedFilter) ShouldCompress(w http.ResponseWriter) bool {
	switch w.Header().Get("Content-Encoding") {
	case "gzip", "compress", "deflate", "br":
		return false
	default:
		return true
	}
}
type ResponseFilterWriter struct {
	filters           []ResponseFilter
	shouldCompress    bool
	statusCodeWritten bool
	*gzipResponseWriter
}