This is one of my core complaints about Go. I'm quite opposed to explicit error handling since ultimately coders will just forget it in places, or not check it correctly. I'm in favour of errors propagating by default, and having a nice option to catch them if you want.
Any repetition is syntax is bad for readability. The intent of the code gets lost in overhead.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Golang is one of my favorites, but writing the same thing over and over annoys me more than anything. I'm talking, of course, about:
Edit: I'm also aware that you can use named return types to do the simplified version below.
There should be a syntax shorthand for commonly used stuff like this. Rust has the
try!()
macro that does this, or even shorter, the?
operator.This is one of my core complaints about Go. I'm quite opposed to explicit error handling since ultimately coders will just forget it in places, or not check it correctly. I'm in favour of errors propagating by default, and having a nice option to catch them if you want.
Any repetition is syntax is bad for readability. The intent of the code gets lost in overhead.