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

Refactor errors to use pointer receivers #602

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

codysoyland
Copy link
Contributor

This PR changes all errors to use pointer receivers, as is common Go idiom.

This doesn't change any behavior. It started as my attempt to fix something I thought was a bug, but I think I misunderstood. I won't feel bad if you decide to close/reject as this doesn't change any behavior and introduces a lot of LoC changes.

Pointer receivers have some benefits for use in error handling -- notably you can compare errors to nil (if err == nil vs if err == MyError{}). The choice is somewhat arbitrary, but using pointers is far more conventional.

Signed-off-by: Cody Soyland <codysoyland@github.com>
@rdimitrov
Copy link
Contributor

@codysoyland - That's nice! 💯 Thank you for addressing this! 👍

@rdimitrov rdimitrov merged commit 3a2b819 into theupdateframework:master Feb 5, 2024
14 checks passed
@codysoyland codysoyland deleted the error-pointers branch February 6, 2024 14:30
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.

2 participants