Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why the use of http.HandlerFunc #174

Open
rickb777 opened this issue Mar 28, 2017 · 2 comments
Open

why the use of http.HandlerFunc #174

rickb777 opened this issue Mar 28, 2017 · 2 comments
Labels

Comments

@rickb777
Copy link

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)
}
@devdinu
Copy link

devdinu commented Apr 8, 2017

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.

@jszwedko
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants