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: unified return parameter format #30947
Comments
You also have to consider the case in which the result parameters have names. |
@ianlancetaylor added result parameters have names. |
Thanks. I think it's a nice feature that the result parameter list looks like the argument parameter list. The exception is that we permit a single unnamed result parameter to not use parentheses. I'm not seeing a good reason to extend that exception to the whole parameter list. |
I don't think Go should enforce that you always need to use parenthesis around the return arguments.
Is already Valid go code, even though you could optionally drop the parens for single-value (non-named) returns. |
Perhaps this would be better suited to |
The current syntax is familiar and simple. This proposal doesn't bring any significant advantage. It does not address any problem that people have writing Go. |
Problem
when we return a value,now is:
some need brackets, and some not
can Go 2 unified all return parameter format in the same?
all has no brackets
or all has brackets
i think it will make the code looks more cleaner.
The text was updated successfully, but these errors were encountered: