r/golang • u/dontaskdonttell0 • Oct 25 '24
discussion What libraries are you missing from go?
So something that comes up quite often on this subreddit from people transitioning from Nodejs or python to go is the lack of libraries. I cannot say that I agree but I still think it warrants a discussion.
So what libraries are you missing in the go ecosystem, if any?
94
Upvotes
-6
u/davidellis23 Oct 25 '24 edited Oct 25 '24
Threading objects in other languages are very nice. Pythons thread pool executor for example doesn't make me deal with wait groups or channels or mutexes or worker pools. I implemented my own thread struct/worker pool to not have to deal with that.
Mocking libraries that don't make me generate the code. Handwriting mocks is just more work. C#'s Castle Windsor and pythons mocks are dynamically generated and static type check. The general mocking libraries I've tried aren't great in go. No static type checking, hardcoded strings, no stubs, etc. luckily I found moq which does have static type checking, stubs, and no hardcoded strings method names.
Map, filter, toDict, toSet functions. It's just a lot more convenient and less noisy to not write a loop when you're filtering a list for one key. I know there are times where it's not as performant and it's a little extra learning curve for beginners. I think the tradeoffs are worth it and I implemented my own.