From 4c5b6dce3c3214f4777639f1998731e80d26ed8e Mon Sep 17 00:00:00 2001 From: Julien Salleyron Date: Thu, 25 Jan 2018 14:50:58 +0100 Subject: [PATCH] Change pointer receiver to value receiver --- gzip.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gzip.go b/gzip.go index 20608c5..ae1ebe4 100644 --- a/gzip.go +++ b/gzip.go @@ -88,7 +88,7 @@ type GzipResponseWriterWithCloseNotify struct { *GzipResponseWriter } -func (w *GzipResponseWriterWithCloseNotify) CloseNotify() <-chan bool { +func (w GzipResponseWriterWithCloseNotify) CloseNotify() <-chan bool { return w.ResponseWriter.(http.CloseNotifier).CloseNotify() } @@ -282,7 +282,7 @@ func GzipHandlerWithOpts(opts ...option) (func(http.Handler) http.Handler, error defer gw.Close() if _, ok := w.(http.CloseNotifier); ok { - gwcn := &GzipResponseWriterWithCloseNotify{gw} + gwcn := GzipResponseWriterWithCloseNotify{gw} h.ServeHTTP(gwcn, r) } else { h.ServeHTTP(gw, r)