Menu

vInsert.nl

What am I even on about

Golang Templates

Another major feature Golang offers are templates. I’m not talking HTML specifically, just about anything that’s made up of text can be turned into a template and generated with Golang, think config files, emails, csv, etc.. (more…)

Golang Readers and Writers

Reader, Writer, ReaderWriter and ReaderWriterCloser are interfaces, interfaces that simply implement Read, Write, Close or any combination. They all take a simple byte slice as their only parameter. Either reading to, or reading from these buffers.
(more…)

Golang WaitGroup

WaitGroup is fairly simple to understand and use, since it’s just a counter that stops blocking when it hits zero. You add to the counter before you create a goroutine, and subtract from the counter once the goroutine is done. You can utilize this to make a thread ‘wait’ for other concurrent operations to finish.
(more…)

Golang Mutexes

One big problem arises that kills our application under seemingly very obscure circumstances. So called “raceconditions” will break everything you love once things start to warm-up scale wise. Your code is suddenly exposed to multiple workers trying to read from/write to the same source. Causing problems that are VERY hard to locate and debug.
(more…)