Я смотрю на этот тип
type GzipResponseWriter struct {
gw *gzip.Writer
http.ResponseWriter
}
И функции, которые будут его реализовывать
func (w GzipResponseWriter) Write(b []byte) (int, error) {
if _, ok := w.Header()["Content-Type"]; !ok {
// If content type is not set, infer it from the uncompressed body.
w.Header().Set("Content-Type", http.DetectContentType(b))
}
return w.gw.Write(b)
}
func (w GzipResponseWriter) Flush() {
w.gw.Flush()
if fw, ok := w.ResponseWriter.(http.Flusher); ok {
fw.Flush()
}
}
Относится ли http.ResponseWriter ко второму полю?
Почему бы и нет
gw1 http.ResponseWriter?