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: don't replace err variable in nested check #22416

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

jolheiser
Copy link
Member

We can use := to make err local to the if-scope instead of overwriting the err in outer scope.

@jolheiser jolheiser added this to the 1.19.0 milestone Jan 12, 2023
Copy link
Member

@strk strk left a comment

Choose a reason for hiding this comment

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

LGTM

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jan 12, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 12, 2023
@jolheiser jolheiser merged commit 1ee1147 into go-gitea:main Jan 12, 2023
@jolheiser jolheiser deleted the err-shadow branch January 12, 2023 20:57
@techknowlogick techknowlogick added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jan 12, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 13, 2023
* upstream/main:
  Continue GCing other repos on error in one repo (go-gitea#22422)
  improve explore relevancy note (go-gitea#22421)
  fix: don't replace err variable in nested check (go-gitea#22416)
  Add more packages to denylist (go-gitea#22412)
  fix wrong theme class when logged out if default theme is changed (go-gitea#22408)
  Update golang deps (go-gitea#22410)
@strk
Copy link
Member

strk commented Jan 13, 2023

This bug also exists in 1.17 (so I guess also in 1.18) -- worth backporting

jolheiser added a commit to jolheiser/gitea that referenced this pull request Jan 13, 2023
We can use `:=` to make `err` local to the if-scope instead of
overwriting the `err` in outer scope.

Signed-off-by: jolheiser <[email protected]>
@jolheiser jolheiser added backport/done All backports for this PR have been created outdated/backport/v1.18 This PR should be backported to Gitea 1.18 labels Jan 13, 2023
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.18 This PR should be backported to Gitea 1.18 type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants