News for hackers. Stuff that matters.
Re:Goodbye, Clean Code by edflsafoiewq on Saturday January 11, 2020 @08:30PM (#22023792)
> The point of Go's error handling is that it isn't magic. There's nothing special about error values, and they are handled exactly the same way as every other variable in the system

The error maybe, but not the result of the call. The multiple-value return x, err is not a first-class value. It cannot be handled like any other variable.

This was demonstrated very clearly with proposal for try. try would have automatically returned with err when err != nil. But what if you wanted to change the error, say create an error message? Then try was completely useless. In Rust, where the result actually is just a regular value, you can transform the error however you like just like any other value and try is just as useful as before.

Re:Goodbye, Clean Code by marcus_holmes on Sunday January 12, 2020 @05:30AM (#22025572)
Sorry, I don't understand what you're saying. Are you saying that because there's a proposal in v2 for error values to not be 1st class values, therefore they're not in v1?
Re:Goodbye, Clean Code by bambataa on Sunday January 12, 2020 @07:55AM (#22026077)
I think it’s that in Go multiple return values aren’t a first class value. It’s just two separate values. Whereas in Rust or Haskell they’d be a single, first-class Result<a> (or whatever) value.