-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: consider using variadic options instead of structs #908
Comments
No; there are many problems with that idea. Here's a list Ross and I compiled a while back:
I'd only use functional options if it they were rarely needed, and only one function in the package could use them. |
Thoughts on a pointer vs a value options structure? I'm liking value options structures right now because then its immediately clear what this extra parameter is for versus nil which masks that. You also don't need to think about whether there is a difference between |
In cases where the options are infrequently used, it's too much of a burden to write |
Currently we are using
Options
structs everywhere. Should we use self-referential option funcs instead?https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html
The text was updated successfully, but these errors were encountered: