kubernetes / git-sync

A sidecar app which clones a git repo and keeps it in sync with the upstream.
Apache License 2.0
2.16k stars 409 forks source link

Fix goroutine leak in git option parsing #788

Closed thockin closed 11 months ago

thockin commented 11 months ago

Alternative to #785

k/k uses goleak, too, so it seemed a reasonable dep.

justinsb commented 11 months ago

LGTM and avoids the "goto" statement that I proposed - thanks.

Not sure why we're using channels here at all TBH, but .. lgtm

/approve /lgtm

k8s-ci-robot commented 11 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, thockin

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/git-sync/blob/master/OWNERS)~~ [thockin] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
thockin commented 11 months ago

The channel is just a simple way of consuming an input string. We could have saved an index, just as easily.