Hello gophers,
We have just released Go 1.20.
To find out what has changed in Go 1.20, read the release notes:
https://go.dev/doc/go1.20
You can download binary and source distributions from our download page:
https://go.dev/dl/#go1.20
If you have Go installed already, an easy way to try
On Wed, Feb 1, 2023 at 11:22 AM Chris Burkert
wrote:
> Looking into the spec:
>
> https://go.dev/ref/spec#Return_statements
> ReturnStmt = "return" [ ExpressionList ] .
> ExpressionList = Expression { "," Expression } .
> ... no () here
>
> https://go.dev/ref/spec#Function_types
> FunctionType
Looking into the spec:
https://go.dev/ref/spec#Return_statements
ReturnStmt = "return" [ ExpressionList ] .
ExpressionList = Expression { "," Expression } .
... no () here
https://go.dev/ref/spec#Function_types
FunctionType = "func" Signature .
Signature = Parameters [ Result ] .
Result
This is really helpful! Thank you!
At first I assumed that it was down to 'go fmt' letting you be fairly loose
with your syntax and that you could omit parentheses where the meaning
wouldn't be ambiguous. But on closer examination, there must be something
else going on because 'return a, b'
Good point, didn't think of that
On Wed, Feb 1, 2023, 15:30 p...@morth.org wrote:
> It would actually be ambiguous in the very place they're required.
>
> Consider this not completely unreasonable example:
> https://go.dev/play/p/OL0uOnPZXju
>
> Also, with generics it could be ambiguous in type
It would actually be ambiguous in the very place they're required.
Consider this not completely unreasonable example:
https://go.dev/play/p/OL0uOnPZXju
Also, with generics it could be ambiguous in type parameters.
To summarize, parentheses are needed around the return types because
otherwise
Hello,
The gollvm build with LLVM tip is currently broken; there have been some
upstream LLVM changes that aren't compatible with the Gollvm bridge code
(notably the opaque pointer migration), which causes build failures. This
is a known problem, I haven't had enough free time to fix it