4 ms·
Actually a bunch of router/web helper libraries do this in different ways which makes it a huge pain to compose middleware from different libraries. Even Mux's
by skrtskrt 4y ago
Actually a bunch of router/web helper libraries do this in different ways which makes it a huge pain to compose middleware from different libraries.
Even Mux's middleware library is not consistent in how it does this for different middlewares so they have to be applied different ways or even have wrapper functions written
- catlifeonmars 4y agoThis. Middlewares typically expect to wrap an http.Handler so you lose all the middleware composition ergonomics by adding a return value to your custom handler signature
- masklinn 4y agoHere it just implements the standard library’s interface rather than use some sort of conversion closure adapter, there’s nothing special to it.