On Wed, Feb 16, 2022 at 4:54 PM Robert Engels wrote:
>
> I think an “on error goto” construct coupled with defer would be a capable
> error handling system. It would eliminate a lot of boiler plate and
> duplicative code.
See https://go.dev/issue/37035.
Ian
> > On Feb 16, 2022, at 6:50 PM, R
On Wed, Feb 16, 2022 at 3:40 PM Robert Engels wrote:
>
> I don’t disagree. It is used in C because they don’t have exceptions so you
> need centralized handling. Go can be viewed as similar in that respect - but
> with some extra limitations and additions.
I'd say that the main reason that peo
I don’t disagree. It is used in C because they don’t have exceptions so you
need centralized handling. Go can be viewed as similar in that respect - but
with some extra limitations and additions.
> On Feb 16, 2022, at 4:53 PM, 'Axel Wagner' via golang-nuts
> wrote:
>
>
> This is golang-nu
This is golang-nuts, though. Not C-nuts. Go's goto statement is
significantly different from C's (see Ian's earlier response). And using it
for error handling in this manner is extremely uncommon.
On Wed, Feb 16, 2022 at 11:12 PM Robert Engels
wrote:
> Using goto for error handling in C is very
Using goto for error handling in C is very common. See the Linux kernel.
> On Feb 16, 2022, at 3:07 PM, Corin Lawson wrote:
>
> Hi Vojta,
>
> Can you please provide some real world examples (e.g. link to open source
> project) or a code style guideline that promotes the use of that pattern o
Hi Vojta,
Can you please provide some real world examples (e.g. link to open source
project) or a code style guideline that promotes the use of that pattern of
using a goto? I don't believe that it is idiomatic Go. Personally, I can
count on one hand the number of times I've seen the usage of