3 ms·
It's the try! macro from Rust! Obviously I'm a big fan of this style of error handling, and I'm happy to see it proposed for Go.
by pcwalton 7y ago
It's the try! macro from Rust! Obviously I'm a big fan of this style of error handling, and I'm happy to see it proposed for Go.
- est31 7y agotry! is dead, long live try.
- danieldk 7y agoWell, try! is dead quite literally. Rust still has the macro, but it is superseded by the ? operator.
- est31 7y agoThat's the pun :). "The king is dead long live the king" originally comes from the French court and actually was used to refer to the old king dying and the heir to become the new king. https://en.wikipedia.org/wiki/The_king_is_dead,_long_live_the_king https://en.wikipedia.org/wiki/The_king_is_dead,_long_live_th...!
- amluto 7y agoExcept it’s missing the part where sum types are used, resulting in oddities about the non-error part of the return value when the error part is set.
- pcwalton 7y agoI mean, sure, but it's the best they can do while remaining compatible with all the Go code out there.