-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: Go 2: add a special returntype "return" #42811
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
Comments
Please note that you should fill https://github.com/golang/proposal/blob/master/go2-language-changes.md when proposing a language change. |
Would you consider yourself a novice, intermediate, or experienced Go programmer? Before:
after:
• What is the cost of this proposal? (Every language change has a cost). |
What should happen if a function with this special return type is called by a function that itself has results? All of your examples seem to be calls from a function that does not have results. |
I'm making a full example. Takes a little more time |
wouldn't this face the same pushback as see also #35093 |
thanks @seankhliao That's exact the functionality what I was looking for. Sorry for bothering you all. |
Is solved with existing functionality:
defer
andpanic
Because I've googled for a long time to find a solution and did not find any I have made an example of an implementation with
defer
,penic
andrecover
. So maybe someone can use it. I have made one function with no return type, one with one return type and one with two return types. I have meed a simple one because the application where I needed it is much more complex. If you have questions send me a pm.start reading in
fun main
The text was updated successfully, but these errors were encountered: