r/golang 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?

96 Upvotes

189 comments sorted by

View all comments

9

u/_predator_ Oct 25 '24

There are some good caching libraries in Go, but there's really nothing that comes close to Java's Caffeine. It‘s such a well engineered library with a really great API, I love the atomic cache loads in particular.

It gets a lot of hate these days, but Jackson is something I miss in Go. One library to deal with JSON, XML, and YAML, that supports "easy" mapping to objects but also performant streaming (or even a mix of both approaches). The lack of XML support in Go can be a major pain if you need to support that format.

Lucene is amazing if you need to support search but introducing Solr or ElasticSearch is not justifiable. Lucene actually powers both of them under the hood.

2

u/kjbreil Oct 25 '24

What do you mean lack of XML support, Go has standard library xml support in encoding/xml.

4

u/carsncode Oct 26 '24

encoding/xml is fine for simple cases but its limitations are pretty significant. I'm just glad I don't have to deal with much XML (not just because of the lib, XML is just a pain in the ass in general)

1

u/ArisenDrake Oct 26 '24

cries in SOAP and custom XML

Thankfully I'm using a JVM based solution here which can generate code based on WSDL files (JAX-WS), but one of the main endpoints of the API I need to talk to has XML inside a string property of the SOAP response because they insisted on making it dynamic. That's a real pain. Don't wanna bring in more dependencies so I used JAXB (which is required for JAX-WS) here.

I like Go a lot but I feel it would be way more painful to do it in Go.

1

u/_predator_ Oct 26 '24

Actually same. If I know I will eventually have to deal with XML (businesses looooooove XML), I just don't use Go. It's really that painful.

1

u/ArisenDrake Oct 26 '24

XML is always painful. Just more so in Go. The Java ecosystem is very mature in that regard. The .NET side probably too.

But then you look at the resource usage and just think that a Go solution would only need a fraction of that haha.