-
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
Can we simplify error handling? #38349
Comments
Thanks for the issue. We are not considering any changes to error handling at this time. If you need more context, this has been discussed at length in the past. A Google search for “go error handling proposals” turns up many of these discussions. |
You can also search the issue tracker at
error-handling
|
See, e.g., #37141. |
I was not considering it to be a change to error handling. The old way can work as usual without a compatibility break. It is just an addition. |
"Change to error handling" means any change that is expected to affect the way that most code handles errors. We aren't going to break compatibility in this area. So all changes to error handling will be additions. As I said above, see the issues linked at
error-handling
|
This is a proposal. I am new to GO and as I understand one of the things about go is a simplification of what is possible to simplify. This Idia become contagious and now this is how I think. When I write GO app very often I return error.
or if I also return a value
Could we simplify it to
or
this is
ereturn
is error return. It will only return if the last element (which shoulderror
) is notnil
otherwise bypass. So the could would look like thisOr if we look at last element to be not
nil
Where
(0)
what to return beforeerror
in the case the last element which is an error innil
, in our case oneint
The text was updated successfully, but these errors were encountered: