A few months ago, I started my journey from PHP to Go on a new app in my company.
Some 3 months after, I posted another Article on DEV talking abo...
For further actions, you may consider blocking this person and/or reporting abuse
For anyone else reading this: do not use the
satori/uuid
package.It has a number of very concerning flaws, with this one being the worst:
Please instead use: github.com/gofrs/uuid
Now on to the topic:
You want to build a Frameworkless App, but you use Gin, which is a framework. This is quite the incompatible premise, would you not say?
I would encourage using
gorilla/mux
for small niceties on top of the standard library, I personally think it's enough.Gin introduces too much magic and special "Gin only" behaviour and I personally am not a fan of that.
I though exactly the same ;)
Thanks for the security alert :)
Thanks for the security alert on using satori/go.uuid.
Regarding gin-gonic, I don't use it as a framework, but just as a router.
I'd get rid of gin, go really doesn't need frameworks.
There are many people who think you need a framework as soon as you start a new language, but forget that idea with go.
If you're using it just for the router, you could use julien schmidt directly.
I would suggest my own, but I don't think it's ready yet. I need to make sure it's bombproof first.
PS. I also switched from PHP, never looked back.
Happy Coding
I switched from gin router to httprouter. It's enough for my needs.
I also dropped viper to use builtin env var funcs.
I also dropped zap to use zerolog which is more simple.
In my toolbox, I gave a chance to gorm which a little ORM for Go.
I have to publish a new edition of my Go toolbox.
Nice, yes, simplicity is key for me.
I really like it too! However I've been using
gorilla/mux
on prod for a long time now and it's never been an issue, I really appreciate it's "battle-hardened" quality and feel.It's one of the rare libraries I feel fully confident with because it's proved itself time and time again.
Not saying this isn't true of
chi
, just that, that wasn't the choice we made for production back then, so I can't compare it at that level yet.Thanks for sharing these packages 📦 I’ve been making a few side projects with Go but always spent too much time trying to find the “right” libraries to use.
My twin brother started using an open-source project called the SaaS Startup Kit . It is an open-source project of Go code to bootstrap your software-as-a-service startup.
gitlab.com/geeks-accelerator/oss/s...
The goal of this project is to provide a proven approach for building new SaaS that reduces the repetitive tasks in getting a new software service launched to production that can easily be scaled and ready to onboard enterprise clients.
Great post! Do you have a recommendation on handling dependencies in your Go projects? This has probably been the biggest source of confusion in my experience with Go.
Hi Esteban!
I gave a chance to
go mod
even if the support is still experimental in the 1.11, because it should be stable in the release 1.12.I bet it will be the future of Go dependency management and will replace
go dep
.I found out that
go mod
is on the good way to be a solid dependency manager for Go. You just have to init yourgo.mod
by typinggo mod init
and then, every time you'll typego get something
, it will add it to your project's dependencies.It's also a good way to organize your code in modules.
This is great stuff. Thanks for sharing! Just starting out with Go myself.
+1 for chi
I created an authentication package here : github.com/dimensi0n/persona (Cookies way only)
At a first glance it seems very similar to echo which I use for personal projects. I'll try to check how they differ, but if you know, please fill me in.
I would also try to use the official MongoDB driver from now on:
github.com/mongodb/mongo-go-driver
When I started learning Go in September of 2018, it wasn't ready for production.
Do you know if it's ready now ?
good one!!