Get the latest tech news
Discussion: Reduce error handling boilerplate in Golang using '?'
This is a discussion about a new syntax that may be used to handle errors. This is issue #71203 converted into a discussion. I've written a tool that converts ordinary Go code into code that uses t...
The goal of this proposal is to introduce a new syntax that reduces the amount of code required to check errors in the normal case, without obscuring flow of control. Since the main goal of this proposal is to reduce boilerplate, I believe that we should try our best to do just that, and introduce err in the scope rather than requiring people to declare it explicitly. However, it may not be too bad: Todd Kulesza did a user study and discovered that people unfamiliar with the syntax were able to see that the code had to do with error handling.
Or read this on Hacker News