I don’t write Go and don’t really intend to start… But that looks like a very nice sort of setup no matter what language it’s in. If those with more experience in backend see deficiencies, I’d be interested in hearing them.
Not a comment with a deficiency, but this is very similar to how things are set up with Clojure, ring for serving and Compojure for routing.
The only thing we do differently is we have controllers (i.e. server types) for each functional area vs. a single server instance.
You can also chain middleware https://github.com/blend/go-sdk/blob/master/web/util.go#L24 vs. wrapping the functions (makes it easier to have a standard array of middleware that you pass around).
Thank you for the example! It’s useful as I embark on my first http service in golang.