negroni
negroni copied to clipboard
why the use of http.HandlerFunc
Why does Negroni use both http.Handler
and http.HandlerFunc
in its API? It's rather inconsistent.
func New(handlers ...Handler) *Negroni
compared with the third parameter in
type Handler interface {
ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
}
negroni.Handler interface will have
ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.Handler)
instead of http.HandlerFunc
.
and we 'll need a new release. But this will affect the consumers when they upgrade. I can change it and raise a PR if owners/maintainers give it a go.
I agree that it is a little inconsistent, but I hesitate to modify this part of the API until a version 2
given the severity of the breaking change.