Type Middleware as type alias
dolmen opened this issue · comments
Olivier Mengué commented
For maximum flexibility type Middleware should be a type alias as it doesn't export any method.
Tanguy ⧓ Herrmann commented
as in
type Middleware = func(http.HandlerFunc) http.HandlerFunc
?
I guess I don't understand the difference in that specific case.
Olivier Mengué commented
At runtime there will not be a specific type allocated. The availability of that specific named type is useless here as what matters is the func signature.
Check fmt.Printf("%T\n", Middleware(nil))
.
Tanguy ⧓ Herrmann commented
Ok, got it.
Seems like a good idea. I'll get it done.