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....