News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by packetlost on Tuesday November 26, 2024 @05:04PM (#42250562)
You would need some form of compile-time reflection/specialization to implement that properly (what if the second return value isn't an error? What if there's only 1 return value?). Further, you would lose the ability to add context to the error branch via fmt.Errorf, which seems rather critical to understandable error conditions.

I'm not sure I would be satisfied with any implementation of try as the language is now, I assume the Go language team would probably feel the same.

There are no comments on this comment yet.