-
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: return sugar #14066
Comments
This has been proposed in dozens of forms ad nauseam here and elsewhere. Even if this were to go through the https://golang.org/s/proposal-process, I have no belief it would fare better than the previous proposals. For previous proposals, I see at least 8 searching the golang-nuts mailing list for "error handling sugar". |
ok :) ps it's a more general return proposal actually not just error's |
You're more than welcome to write a formal proposal using https://golang.org/s/proposal-process but the bar for language changes at this point is pretty much impossible (and has been for years), so you'd have to be very convincing with lots of data to back you up on how this would affect Go programs out there. |
Understandably so :) you don't want to have a python 2, 3 scenario. I couldn't see any issue for breaking current syntax but I am not a expert. Anyway will ask for more expert advice. https://forum.golangbridge.org/t/proposal-return-sugar/1858 |
I looked around and didn't find any tickets about it, but what about a little bit of sugar for a optional auto return values as soon as there are assigned and none of them is nil using the following syntax?
Which unclutters the code allot when you have many return's in a function http://play.golang.org/p/2kEKXq-kUV
The text was updated successfully, but these errors were encountered: