3 ms·
After building apps in Martini and Revel, I’ve moved to using a smattering of decent (IMHO) packages good at 1 thing: Let me render templates in a layout file
by astockwell 8y ago
After building apps in Martini and Revel, I’ve moved to using a smattering of decent (IMHO) packages good at 1 thing:
Let me render templates in a layout file with `yield` - https://github.com/unrolled/render https://github.com/unrolled/render
Let me quickly route with param support - https://github.com/julienschmidt/httprouter https://github.com/julienschmidt/httprouter
Sessions, flash messages, and secure cookies - http://www.gorillatoolkit.org/pkg/sessions http://www.gorillatoolkit.org/pkg/sessions
POST parameter-to-structure binding (this is optional and easy enough to do by hand) - https://github.com/mholt/binding https://github.com/mholt/binding
I write my own middlewares for logging, auth, etc. Use viper for configuration, gorm for an ORM, and for anything more complicated, accept that you’re about to learn a whole lot about it because you’re gonna be writing it yourself.
- astockwell 8y agoOH! And json-to-go people, use json-to-go. Thank me (well, mholt really) later!
- guessmyname 8y agoHere is a link for the lazy [1]. @mholt also created curl-to-go [2]. [1] https://mholt.github.io/json-to-go/ https://mholt.github.io/json-to-go/ [2] https://mholt.github.io/curl-to-go/ https://mholt.github.io/curl-to-go/