Skip to content

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