3 ms·
Martini is cool but you probably don't need it. The main thing lacking from net/http is a flexible router. Using the standard mux and parse params out of the r
by shirro 12y ago
Martini is cool but you probably don't need it.
The main thing lacking from net/http is a flexible router. Using the standard mux and parse params out of the request is doable but something like httprouter is often worthwhile.
Wrapping Handle or HandleFunc is easy enough that you don't really need some framework for middleware. If you keep to the standard interface there is plenty of middleware about if you need it. Though you can use things like Gorilla context for request context it is so easy to use a map of requests pointers to data protected by a mutex it seems silly to use a library to do it.
I feel like Go is a bit of an anti-framework language in general. Anyone trying to offer an all-things-to-everyone solution is going to stray into reflection and interface{} everywhere and I think the more Go you write, the less happy you get with this sort of approach.