News for hackers. Stuff that matters.
Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by kareemsabri on Tuesday August 16, 2022 @10:09PM (#32491488)
Yes, in 2017 and 3 companies later I've never looked back. Current application is an event-sourced system that includes a REST API, asynchronous event processing over SSE, and a scheduled job runner.

It's been great. We don't use any frameworks, just the http package. It's blazing fast and highly reliable (low bug occurrence and easy refactors due to the safety provided by strong typing).

Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by jjice on Wednesday August 17, 2022 @10:23AM (#32496813)
If you're open to it, I'm curious about a few things:

1. How do you handle DB interactions? A data mapper/repository pattern?

2. Do you have a service layer to coordinate between the different "inputs" (the REST API, event processing, and scheduled jobs)

3. Is this REST API used by a web front end or other services? Interested in how people handle token auth and/or using session tokens.

I've been reading about architecture patterns more and I've realized which patterns I've used without knowing it, so now I'm interested in how others handle similar situations in different languages and ecosystems.

Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by Cwizard on Wednesday August 17, 2022 @04:23AM (#32493738)
What were you using before Go? I notice in the relies that a lot of people are coming from Python. Did you consider using Java? And if so what made you use Go in the end?
Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by kareemsabri on Wednesday August 17, 2022 @07:05AM (#32494650)
I've used many languages in my career, including Java, Scala, Ruby, and Node. I didn't really consider Java, for a couple of reasons.

- I didn't love the Java tooling at the time. Maven for example. - I don't love OOP. Go has just enough OOP patterns for me.

I tried Go as an experiment, but didn't know it would become my go-to language. What I found was super fast build times (big win), built in testing, and a simple language that almost anyone can understand (versus the relative sophistication of something like Scala).

Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by deniswsrosa on Wednesday August 17, 2022 @11:49AM (#32497938)
Which framework do you use to create your rest endpoints?
Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by kareemsabri on Wednesday August 17, 2022 @01:38PM (#32499393)