News for hackers. Stuff that matters.
Re:Go 2 Draft Designs by spullara on Tuesday August 28, 2018 @12:48PM (#17860393)
Ok, we won't call them exception handlers. Instead, call them "if anything goes wrong in this function do this" handlers.
Re:Go 2 Draft Designs by SamWhited on Tuesday August 28, 2018 @01:59PM (#17861136)
Those are very different things, whatever you want to call them. check/handle doesn't involve unwinding the stack, and doesn't default to crashing your program if you forget to add a handle block.
Re:Go 2 Draft Designs by tonyedgecombe on Tuesday August 28, 2018 @02:45PM (#17861633)
and doesn't default to crashing your program if you forget to add a handle block

Is that a good thing?

Re:Go 2 Draft Designs by grey-area on Tuesday August 28, 2018 @03:13PM (#17861930)
Is that a good thing?

Yes, because instead your program won’t compile if you forget to handle an error ( except in the case of a function which only returns error, which you can ignore by mistake - I would like to see that fixed in go 2 as well).

Re:Go 2 Draft Designs by fwip on Tuesday August 28, 2018 @07:04PM (#17863704)
Expect to see a lot of `_, _ = fmt.Println(...)`, then.
Re:Go 2 Draft Designs by grey-area on Wednesday August 29, 2018 @02:42PM (#17870577)
Since they’re calling it go 2 perhaps they could just make an exception for println by having an alternative with no error (like map access with k,ok or just k).