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

Inconsistent object declaration #71

Closed
maruina opened this issue May 7, 2021 · 0 comments · Fixed by #85
Closed

Inconsistent object declaration #71

maruina opened this issue May 7, 2021 · 0 comments · Fixed by #85
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@maruina
Copy link
Contributor

maruina commented May 7, 2021

We are not consistent when we declare a new object.

Sometimes we do something like

pr := deploymentskyscannernetv1alpha1.ProgressiveRollout{}

and sometimes we do

pr := &deploymentskyscannernetv1alpha1.ProgressiveRollout{}

We agreed on using the first format because then it's very explicit when you need to pass a reference to it. For example

if err := r.Get(ctx, req.NamespacedName, &pr); err != nil {...}

is more clear then

if err := r.Get(ctx, req.NamespacedName, pr); err != nil {...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants