Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: