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

Fix label-selector example #2

Merged
merged 1 commit into from Feb 26, 2022

Conversation

nikhil-thomas
Copy link
Contributor

At present, the selector remains empty even after the sel.Add(req) call.

fmt.Printf("%v", sel) prints empty string.

This is because the mutated sel is not reveived and assigned to sel at the caller.

note: the signature of sel.Add function is Add(r ...Requirement) Selector

Signed-off-by: Nikhil Thomas nikhilthomas1@gmail.com

At present, the selector remains empty even after the `sel.Add(req)` call.

`fmt.Printf("%v", sel)` prints empty string.

This is because the mutated sel is not reveived and assigned to sel at the caller.

note: the signature of sel.Add function is `Add(r ...Requirement) Selector`

Signed-off-by: Nikhil Thomas <nikhilthomas1@gmail.com>
@iximiuz
Copy link
Owner

iximiuz commented Feb 26, 2022

Good catch! The Add() behavior turns out to be quite confusing!

@iximiuz iximiuz merged commit 99e4328 into iximiuz:main Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants