Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're coming from Ruby, you might like Gin[0].

I'd also recommend learning to write web APIs with the standard library so you know the primitives. Writing Web Applications[1] on golang.org covers the basics.

[0] https://github.com/gin-gonic/gin

[1] https://golang.org/doc/articles/wiki



I've had a bad experience with Gin and when asking about alternatives in a local Go meetup I was given the advice to use https://github.com/go-chi/chi or gorilla/mux.


Could you go into more detail about this? I'm using Gin currently and would like to avoid any potential landmines if possible.


I've used Gin for several small to medium projects without too much difficulty. I think Gin is a good way to learn quickly since its ecosystem introduces you to a lot of the pieces you will need. Personally, I don't do enough web development to grow out of it, since my web related projects are not a primary focus.

One thing to note is that Gin's Context is not the standard context.Context, which some find problematic. Most (vocal?) Gophers prefer sticking with the standard library and Gorilla.


It's true that Gin's Context is different from context.Context, but I don't see how that's inherently problematic.


I didn't like Gin because they don't let you use whatever routes you want. Something like /:category/:product and /user/:name (notice no ":") is not admissible because ":category" in the first route clashes with "user" in the second route (wtf?)


I've definitely been bitten by this and the work around is pretty hacky.


It's not super helpful to recommend alternatives without providing any reasoning. I've used all of the above and Gin has been fine for me for standard HTTP APIs. The exception is web sockets, but you can use gorilla/mux in conjunction with with Gin for that.


chi is nice in that it is just a router, not a whole framework. It uses the existing http middleware idioms from the standard library. If you want to route some incoming requests by url to handlers in go code, chi is pretty reasonable.

context: working in large org building backend services that speak to other backend services via various crappy http / rest / soap APIs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: