There are known bugs in this library. Please consider using another one. Maybe this one: https://github.com/NYTimes/gziphandler
Package httpgzip provides a http handler wrapper to transparently add gzip compression. Documentation: https://godoc.org/github.com/daaku/go.httpgzip