The power of generics in go for the repository pattern? #545
frederikhors
started this conversation in
Ideas
Replies: 1 comment
-
I have limited experience with generics, but I believe they are not very useful for ORMs like Bun or GORM. You could create few utility functions that will save 2-3 lines of code, but it won't be much. I am open for suggestions, but since Bun supports 2 last Go versions, we can only start using generics after Go 1.19 is released - which should happen relatively soon. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just found this awesome post: https://hindenbug.io/the-power-of-generics-in-go-the-repository-pattern-for-gorm-7f8891df0934.
What do you think guys?
On reddit the discussion is hot too: https://www.reddit.com/r/golang/comments/u9bti2/the_power_of_generics_in_go_the_repository.
I'm repeating (manually or by code generation) a lot of times the same code in many files for this.
What we can do?
Beta Was this translation helpful? Give feedback.
All reactions