Go Lang

How to implement timeout in go routines

How to implement timeout in go routines

Go lang simple workers with timeout using context

I wanted to implement a timeout in go routines. There are a couple o ways doing that. We could use context.WithTimeout() or we go with classical sync.WaitGroup group with a trick.

Let’s start with the first one.

How to upload to S3 with presigned URL

Dealing with presigned URL

Object storage is getting more and more popular. AWS started, but nowadays, almost every provider has it. Recently Cloudflare announced its availability. DigitalOcean call them Spaces.

So today, we are trying to upload a file to an S3 type of storage with a presigned URL.

TL;DR: how to generate the correct URL and upload data into it.

Docker, GO and CGO application build

Docker, GO and CGO application build

I’ve been avoiding Docker for a very long time. I started as a sysadmin setting up servers running FreeBSD and early versions of Debian on bare-bone servers. As soon as “cloud” came into the market, I switched to AWS and GCE and have used them since then. EC2 was my always goto choice to deploy something on the internet quickly. But Docker — for some reason, I was avoiding it until this two years ago, when I started using it. Without too much trust.

But today, history is not about my love & hate relationship with Docker, but about deploying the GO application and VIPS library. A couple of problems appeared during the process, and it’s worth mentioning them for future generations because I could find much help around my issues.