Photo by [Uta Scholl](https://unsplash.com/@uta_scholl) on [Unsplash](https://unsplash.com/photos/ipUuGGUgR5A)

Go Generics

The latest release of Go (1.18) added generics to the language, besides fuzzing, workspaces and performance improvements. 1 So let’s use them to implement the repository pattern, which is a way to abstract data handling from your business logic. When working on REST-like APIs you want to split handling of data from and into some kind of data store (e.g. a database, a file, …) from business logic. This is where the repository pattern comes in handy....

May 1, 2022 · 5 min · 915 words · André Sterba