Ask HN: Anyone here switch to Go for building (REST) APIs?
1–10 of 51 posts
As the title states, did you switch to Go/Golang for developing REST api’s or other kinds of web services? What has been your experience? Would you use Go again in the future? Would you rather use something else?
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#2Yup, Go is great. It's simple and fast. There are great libraries and it's a lot of fun.
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#3Yes. And will use again.
Using it with grpc-gateway is a great experience. It will generate Openapi 3 specs for your clients to consume.
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#4Yes. From Python to Go. Types and compile get the 90% of the bugs which otherwise I get them in run time at least in Python
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#5Yup, Go is great. It's simple and fast. There are great libraries and it's a lot of fun.
Yes there is something about it that is actually fun... there's a productivity sweet spot, it makes sense and you know it's probably going to work first time (at least compared to many other languages) - so you spend more time expressing ideas and solving problems.
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#6Look into the embedded filesystem for storing static stats and metric pages, it's nice to have that packaged up in the same single binary and goes a long way in making small webserver utilities more usable.
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#7I went from Python to Go to Rust. Go plays up this fantasy of types helping you catch bugs, buts it’s really C with lipstick. There’s no enums, no exhaustive matching of any kinds, there’s null to worry about everywhere, and every utility function has to be painfully written out for each type (maybe that’s starting to change now with Go having basic support for generics).
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#8Oh yeah, REST APIs are one of Go’s sweet spots. I have yet to find a better language for APIs and CLIs
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#9For those that build REST APIs in Go, do you use an OpenAPI generator to scaffold most of it?
Re: Ask HN: Anyone here switch to Go for building (REST) APIs?
#10First of, just like the term "hacker" became popularized by the media and turned into the meaning of someone who cracks computers and software, so has HTTP based APIs been popularized and turned into REST applications, but this is wrong. A HTTP based API cannot, by its very nature, ever be REST.
Now that's out of the way, yes. We use Go for both API and web development, actually full stack WITHOUT any JavaScript. We have written a custom error handler that deals with runtime HTML template errors, if any, which improves the otherwise tedious work when a template makes the web service crash.
Go is superb at HTTP and all web related. We still have some PHP development, but would very much like to do Go all the way, we just haven't gotten there yet.
Last, but not least, we do not use any frameworks or libraries, only the Go standard library and we love it. No matter were we put it, it just always works and is very performant.