Anthony Alaribe
1 min readJun 26, 2018

--

Hello Gant, you’re actually very correct, although while it’s true that standard library has it all, there is some ease that comes with using routing libraries.

  • I don’t like having to split my strings or use regex to find URL params
  • I don’t like having r.Method checks littered around my handlers.
  • I like how easy it becomes to logically group my routes, when using a handler.
  • Most routing libraries come with a nice way of chaining middlewares, which i like, compared to multiple levels of middleware functions calling each other.

But don’t get me wrong, I still maintain some projects which I built on standard library routing, and i don’t regret doing so, but code i build with routing libraries turn out to be neater, and i’m much more productive.

Oh, and throwing maps into a marshaller isn’t a good practice depending on the scenerio, but this is a quick example, created to show else, and not how to handle json.

--

--

Anthony Alaribe
Anthony Alaribe

Written by Anthony Alaribe

I help solve business challenges using technology. Golang and Web optimisation (PWA, service workers, progressive enhancement)

No responses yet