News for hackers. Stuff that matters.
Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by Cwizard on Wednesday August 17, 2022 @04:21AM (#32493725)
Can I ask about the choice to not use any libraries? As in your go.mod file is empty? I understand the desire to keep dependencies to a minimum but surely there are use cases where it is better to import existing code rather than writing something from scratch no?

Do you use internal libraries?

Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by iio7 on Wednesday August 17, 2022 @08:44AM (#32495521)
We basically only use the Go standard library. So far we have found no use cases where that didn't cover us well enough.

This also removes any problems with third party dependencies that suddenly gets abandoned yet still have serious issues, supply chain attack problems, etc.

We have also found that most third party libraries tries to be (more or less) general purpose, so they often contain lots of stuff we would never need, so we prefer to e.g. write our own specific code.

The way we work require a little extra effort because we write the things we need our selves, but of course we reuse our HTTP handler code, our custom runtime error handler code, etc., from project to project, but in general the benefits far outweigh the cost in our experience. The fewer dependencies, the fewer problems - and Go shines in this because of how much is covered in the standard library.

Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by Cwizard on Wednesday August 17, 2022 @10:00AM (#32496503)
Makes sense, thanks for taking the time.