Thoughts on writing webapps in Go
When it comes to writing webapps, Go seems to have a lot going (ha!) for it – a straightforward concurrency model; simple compile-and-go deployments; and a standard library with all the proper networking primitives. That being said, it’s a relatively new language and the ecosystem doesn’t quite feel there yet. Below are some thoughts I had after developing DrDebber, a debian-repo-as-a-service. tl;dr: patch together a microframework with Gorilla and an ORM of your choice (I settled on gorp).
The basics
The net/http package in go’s standard library will go farther than, say, python’s equivalent, although that’s not saying much – it’s functional enough to be dangerous but has some rough edges. URL routing, for example, is a bit too basic. URLs are matched simply on prefix and don’t support variable binding – instead of e.g. /frobnicate/:id
, routes look like /frobnicate/
and we’re stuck...