4 ms·
I like this write up. Nicely done! One think I have enjoyed doing is using named parameters as the options, but it does require a second struct only for the opt
by evanmoran 2y ago
I like this write up. Nicely done! One think I have enjoyed doing is using named parameters as the options, but it does require a second struct only for the option parts:
NewObject(
required1,
required2,
&ObjectOptions{
Option1: “foo”,
// Option2 skipped
Option3: “bar”,
})
I can see the merits of both (two structs is tedious, for sure), but I wanted to share in case others had thoughts or alternate ideas!