HTTP etag support middleware for Go.
go get -u github.com/go-http-utils/etag
API documentation can be found here: https://godoc.org/github.com/go-http-utils/etag
import (
"github.com/go-http-utils/etag"
)mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
res.Write([]byte("Hello World"))
})
http.ListenAndServe(":8080", etag.Handler(mux, false))