If you found this article, than you are probably similar to how I was a few months ago. I started a project in Go that required a SQL backend and I...
For further actions, you may consider blocking this person and/or reporting abuse
what do you think about gorm.io/ ?
burn it with fire, 8 levels deep nested reflection source code, a beginner's nightmare
I have never dived into that project, but that source sounds like a nightmare. Is the use of reflection that only way to pull off a library like that?
yea it requires parsing from struct tags for your custom structs but the problem with gorm is struct tag abuse and so many reflection caused by it
If you wanna skip SQL for an interview and wanna do very basic non-relational CRUD, it is the only use case of it.
Else, most of prod codebases uses standard library paired with sqlx or pgscan or sqlc lightweight approaches that only scans SQL results to given 1-by-1 fields with minimal "sql" struct tag parsing or with the help of Go type assertions on sql package types
I see, good to know what can be found in more real-world scenarios for Go and SQL.
Don't trust words alone. ~35k stars for Gorm repo should tell you something.
You can also check performance benchmarks: github.com/efectn/go-orm-benchmark...
It's not the best and not the worst.
Reflection is just another tool, that you shouldn't afraid.
Same thing is for Gorm, if you know where and how to use - go for it.
If not - it can be a good reason to learn/investigate.