Skip to content
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

Use functional parameters in Controller creation #104

Closed
dzlier-gcp opened this issue Feb 23, 2018 · 3 comments
Closed

Use functional parameters in Controller creation #104

dzlier-gcp opened this issue Feb 23, 2018 · 3 comments
Labels
kind/cleanup Refactoring code, fixing up documentation, etc kind/design Proposal discussing new features / fixes and how they should be implemented
Milestone

Comments

@dzlier-gcp
Copy link
Contributor

The constructor for Controller in controller.go is becoming unwieldy and has the potential to be error-prone as more parameters are added.

Go makes use of functional parameters in a similar way that some other languages use Builders. We should consider doing so as well to help readability as more developers start working on the project.

@markmandel
Copy link
Collaborator

Is there a way we can tie default values from the cmd section back to default values in the controller (or vice versa).

My only issue I have with doing this is that we could have default values set in two places, with different default values, which is potentially error prone.

If we can solve this issue, I'm all for it. (It may also lead to a nice pattern in cmd, because the huge list of flags is also really long and not that nice either)

@markmandel markmandel added kind/cleanup Refactoring code, fixing up documentation, etc kind/design Proposal discussing new features / fixes and how they should be implemented labels Feb 23, 2018
markmandel referenced this issue in markmandel/agones Jun 8, 2018
@markmandel
Copy link
Collaborator

Any objections to me closing this issue? Looks like the pattern we have now solves this for the moment?

@markmandel
Copy link
Collaborator

Going to close this, sounds like it's not an issue anymore.

Please re-open as needed.

@markmandel markmandel added this to the 0.5.0 milestone Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Refactoring code, fixing up documentation, etc kind/design Proposal discussing new features / fixes and how they should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants