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

lint: break out of loop, not just out of select statement #785

Closed
wants to merge 1 commit into from

Conversation

justinsb
Copy link
Member

Caught by staticcheck:

main.go:2083:5: ineffective break statement. Did you mean to break out of the outer loop? (SA4011)

Caught by staticcheck:

main.go:2083:5: ineffective break statement. Did you mean to break out of the outer loop? (SA4011)
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 29, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: justinsb
Once this PR has been reviewed and has the lgtm label, please assign thockin for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 29, 2023
@@ -2077,10 +2077,11 @@ func parseGitConfigs(configsFlag string) ([]keyVal, error) {
ch := make(chan rune)
stop := make(chan bool)
go func() {
loopOverConfigFlags:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, BUT....this whole function is borked. We never send stop, so we leave a dangling goroutine. I only vaguely recall this code, and frankly, I am not sure what I was thinking. I think this can be much simpler.

Adding leak detection to the test proves it.

I'm going to close this and send a different one which doesn't leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants