Why I Prefer Structs Over Variadic Functions in Go
After several years of practicing Go, I must admit that I’m not a big fan of variadic functions1. I’ll try to explain why and why I greatly prefer using structs. Definition Let’s start with a quick reminder of what variadic functions are for those unfamiliar with the concept. This pattern is generally used to configure options in a flexible/dynamic way when creating an instance of a structure. Let’s look at a concrete example: ...