Re: [go-nuts] Error Handling in Go 2

2020-07-30 Thread Kaveh Shahbazian
In that proposal, some more syntax and semantics are being added - IMHO. One problem here is the name of the error variable. Here we explicitly have to used named return values - no new syntax there. And return() and panic() on left side, only accept error type. They will only be triggered when

Re: [go-nuts] Error Handling in Go 2

2020-07-29 Thread Ian Lance Taylor
On Wed, Jul 29, 2020 at 7:46 AM Kaveh Shahbazian wrote: > > Go can already pass/pipe the result of a function, which returns multiple > values, to another function, which accepts the same values as arguments. A > similar mechanism can be used for handling errors, by passing/pipe them to a > spe

[go-nuts] Error Handling in Go 2

2020-07-29 Thread Kaveh Shahbazian
Go can already pass/pipe the result of a function, which returns multiple values, to another function, which accepts the same values as arguments. A similar mechanism can be used for handling errors, by passing/pipe them to a special construct. Now, assume we have a function named funcCtx: fun