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
xerrors: adds IsOneOf #1
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
Thanks so much for your contribution. Unfortunately, we can't accept it in this form. First, Go development is done with Gerrit (see https://go-review.googlesource.com). We don't accept GitHub PRs. Second, the Although you're welcome to make your case on the issue, we think it's unlikely that Of course, you are free to use it in your own code. |
To clarify, we do accept GitHub PRs (they get imported into Gerrit via GerritBot) in other repositories that are not a part of a pending proposal. |
@jba Thanks for the reply! I was under the impression that there was a bridge from GitHub to Gerrit which is why I submitted this PR. This was confirmed by dmitshur above. However, I was not aware that the xerrors package was still under proposal. My apologies for the premature PR!! While I understand the intent is to keep go core APIs small, I also believe |
Thanks for your suggestion. Please make it on the issue. |
After reading Proposal: Go 2 Error Inspection I absolutely loved the introduction of the
Is
API. I looked around some of my go codebases and immediately realized how it could improve readability by removing verbose equality checking. After this exercise, I saw how the introduction of anIsOneOf
API would further remove verbosity by allowing for the following change:Before
After
I believe the After is both more terse and readable. To that end, I have created this pull request.