DEV Community

Discussion on: My Favorite Go 2 Proposals

Collapse
 
okolbay profile image
andrew • Edited

can you elaborate on how it is more explicit? it is really stopping execution of collected code block and jumps to if err != nil block?

edit:
looks like it is,
Whenever _! is assigned to, an implicit nil check is performed, and if _! is not nil, the block ceases execution.

from original proposal desription

doesnt look differrnt from throw-catch like semantics of other languages

Thread Thread
 
dean profile image
dean

When I say it's more explicit, I mean that in a typical try-catch, there's absolutely no indication as to where the error came from. This at least shows which places the error could have came from. Again, it's not my favorite thing in the world, but I'm not entirely against it