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

misc: get rid of Go label breaks & gotos #1511

Merged
merged 2 commits into from
Apr 19, 2023

Conversation

mhofstetter
Copy link
Member

@mhofstetter mhofstetter commented Apr 13, 2023

This PR removes usages of Go label breaks & goto. IMO they should be avoided whenever possible.

Most often, they are replaced with introducing an extracted function. Beside getting rid of the statements itself - this approach also improves readability.

Go's label breaks should be avoided where possible.

This commit replaces label breaks with the usage of extracted
functions. Beside getting rid of the label break, they improve
readability too.

Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Go's goto statement should be avoided where possible.

This commit replaces goto statements to labels with the usage of
extracted functions or for loops. Beside getting rid of the goto
statement, this approach improves the readability.

Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
@mhofstetter mhofstetter temporarily deployed to ci April 13, 2023 10:20 — with GitHub Actions Inactive
@mhofstetter mhofstetter marked this pull request as ready for review April 13, 2023 11:45
@mhofstetter mhofstetter requested review from a team as code owners April 13, 2023 11:45
@tklauser tklauser merged commit 9c3ea4c into cilium:master Apr 19, 2023
12 checks passed
@mhofstetter mhofstetter deleted the pr/mhofstetter/rem-label branch April 19, 2023 08:54
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