3 ms·
To each their own, but I personally prefer the lego-building block-approach instead of the kitchen-sink approach of bigger frameworks. In Go at least, this scal
by ereyes01 8y ago
To each their own, but I personally prefer the lego-building block-approach instead of the kitchen-sink approach of bigger frameworks. In Go at least, this scales quite nicely with your code IMO.
I use a couple of thin layers over net/http:
Gorilla mux: https://github.com/gorilla/mux https://github.com/gorilla/mux
... Gets me easy route params and HTTP method filtering.
Negroni for middleware: https://github.com/urfave/negroni https://github.com/urfave/negroni
... Super easy to roll your own, plus there's a bunch of random off-the-shelf middlewares that people have put together (see their README).
For talking with my DB, I just use sqlx (and sqlmock in my unit tests).
https://github.com/jmoiron/sqlx https://github.com/jmoiron/sqlx
https://github.com/DATA-DOG/go-sqlmock https://github.com/DATA-DOG/go-sqlmock