8
scout
3y

Golang - should I use gin or should I not? Beginner here…..
It’s for a huge e-commerce rest api btw

Comments
  • 8
    You really don't want to make your technical decisions based on devrant.
  • 19
    Not sure whether you should use gin - but if you do, add it to tonic water first.
  • 3
    🤔 I haven't used it in a production environment. Works ok for small APis though.

    @AleCx04 have you used gin?
  • 5
    Yes, and also whisky, vodka and rum.
  • 2
    Gin is fine imo, using it for our microservice cloud and it'd pretty neat. There are many libraries to integrate with such as prometheus metrics, swagger ui and logging
  • 1
    @d4ng3r0u5 fucking beat me to it.
  • 0
    At least familiarise yourself a bit with the build-in http package of you are new to Go.
    I would almost always recommend using the OpenAPI tools generator. It is compatible with both gin and echo:
    https://github.com/OpenAPITools/...
    It allows you to focus on on designing the spec in yaml/json/swagger-ui and already handles some basic validation for you.
    You probably also want to check out echo and compare it to gin to see what suits the project best. The build in package probably isn't going to cut it.
  • 3
    Why is a beginner in charge of making the tech stack for a huge commercial project?
  • 0
    Drinking while working is great.

    Gotta hit that Balmer's Peak
  • 1
    @mabbott94 awesome thanks.
    I’m not a new dev, I work on many techs from almost a decade. With go, I have built small stuff using mux, net/http etc. they have worked good enough for me so far but they were only pet projects for learning. But now this is first big one and it really is big. So to use gin or echo or just mux, I’m unable to decide.
  • 3
    Rum is my go-to.
  • 0
    @mabbott94 I just thought that gin is huge framework so that would be handling a lot of things which I don’t know? If it’s not so then I don’t see why such a heavy thing should be used. Why do people use it anyway?
  • 1
    @C0D4 no not really. With Golang I (much like with everything else really) take a library oriented approach rather than the framework approach. We have some golang based products, very small things at work ranging from cli tools to small restful api servers in which I use the base net/http libraries for most of it coupled with gorilla and gorm among other small libs.

    I wouldn't know how well Gin compares. But judging by how the community in Golang is, it seems that they all prefer to build everything using a selection of libraries rather than an all inclusive framework. I don't think there is anything bad with it, this is more of a preference to me. Gin might be fantastic, but I have never used it.
Add Comment