-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
proposal: Go 2: permit using errors.Return, etc., on LHS of an error assignment #37085
Comments
I'm sorry, but I don't understand what you are proposing. Are you suggesting essentially something like extension methods, but only for errors, that would be able to handle the error in place by being callable on the left-hand side of an assignment? |
For language change proposals, please fill out the template at https://go.googlesource.com/proposal/+/bd3ac287ccbebb2d12a386f1f1447876dd74b54d/go2-language-changes.md . When you are done, please reply to the issue with Thanks! |
I appreciate Ian for a better title. I know Go is an opinionated language, apology in advance if the proposal does not look good or other folks have brought up, already my background experience is Mechatronics and working in IT industry and I have nothing else to add in this proposal.
You are less likely miss out handling an error, it happened to my case.
To
|
@gopherbot please remove label WaitingForInfo |
We don't understand your example code. The after code doesn't seem to correspond to the before code. We would need an exact and complete list of available options. Things like -- for @golang/proposal-review |
Based on the lack of further information, and the negative emoji voting, this is a likely decline. Leave open for four week for final comments. |
No further comments. |
This approach has probably been discussed in the past. I like to make this a quick feedback.
Existing code:
If I could instantly identify different type of errors handling in a quick reading, it could be written with
errors.###
that are implements to receive strings, custom types, etc:Radom ideas when return errors from
.NewBackground()
is not null:Go runtime will handles according to each API.
Does this make sense for handling common errors? I could be wrong as to how these approach works or could be done on package.
The text was updated successfully, but these errors were encountered: