minifier/minifier.go
func NewHandler(h http.Handler, logFunc LogFunc) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		mw := &minifyResponseWriter{mw: minifier.ResponseWriter(w, r), w: w}
		h.ServeHTTP(mw, r)
		if err := mw.Close(); err != nil && err != minify.ErrNotExist && logFunc != nil {
			logFunc("minifier %q: %v", r.URL.String(), err)
		}
	})
}
func NewHandler(h http.Handler, logFunc LogFunc) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		mw := &minifyResponseWriter{mw: minifier.ResponseWriter(w, r), w: w}
		h.ServeHTTP(mw, r)
		if err := mw.Close(); err != nil && err != minify.ErrNotExist && logFunc != nil {
			logFunc("minifier %q: %v", r.URL.String(), err)
		}
	})
}
// NewHandler returns a minifer http handler that implements common http.Hander
// related interfaces and uses a common configuration for github.com/tdewolff/minify.