-
Notifications
You must be signed in to change notification settings - Fork 152
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
inconvenient Constructor type alias #20
Comments
Maybe add a little wrapper function like so: https://play.golang.org/p/OTP4olTA6T? |
The life of users of this package would be easier by just defining type Constructor = func(http.Handler) http.Handler That would solve @arussellsaw's problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
type Constructor func(http.Handler) http.Handler
is used for defining middleware functions, and is used as part ofNew(constructors ...Constructor) {
this has caused some problems for me due to the lack of implicit type aliasing on sliced variadic parameters. example here: https://play.golang.org/p/5arBiRLckGthe issue i'm facing is that i'm writing a package where i'd like to users to be able to define a slice of func(http.Handler) http.Handler and not have to import alice in order to provide them. i know i can iterate and manually do the type conversion, and i'm doing that for now, but i figured i'd make this issue anyway just as something for you to consider.
Thanks
The text was updated successfully, but these errors were encountered: