Der Unterschied zwischen Vergangenheit, Gegenwart und Zukunft ist eine Illusion, wenn auch eine hartnäckige. - Albert Einstein.

Let's make your slice/map easier to maintain

Introduction As a Go and Ruby on Rails (RoR) developer, I often find myself building microservices that interact with RoR applications. One of the most annoying challenges is maintaining simple data structures like maps or slices, especially when they need to evolve. For example, let’s take a look at how we define a slice of Partner structs: type Partner struct { Name string } func ListPartners() []Partner { return []Partner{ {Name: "partner1"}, {Name: "partner2"}, {Name: "partner3"}, {Name: "partner4"}, } } At first glance, this looks fine....

August 28, 2024 · 2 min · 404 words · Michael

Let's talk about Go channel

What is Channel If you’re a new Go developer, you’ve likely heard of or used a channel before. But what exactly is a channel, and what is its purpose? Before we delve deeper, let’s first discuss this. So, what is a channel? According to the official Go documentation, a channel is Channels are a typed conduit through which you can send and receive values with the channel operator, <-. basically, you can say that Channel is a communication mechanism....

August 16, 2024 · 5 min · 945 words · Michael