News for hackers. Stuff that matters.
Re:Announcing Rust 1.13 by cpuguy83 on Thursday November 10, 2016 @04:27PM (#12924553)
The only thing bad about Go's version (other than the usual repetitive code complaints) is it's easy to ignore (ie forget) to handle an error.

And really much of the error handling in Go is by convention (ie, `if err != nil { return nil, err }`) rather than actual language semantics.

Honestly it would be nice to be able to always return the error (without special macros or symbols) if there is one unless I've explicitly setup a handler block.

Re:Announcing Rust 1.13 by brandur on Thursday November 10, 2016 @04:49PM (#12924744)
I've also found (the hard way) that it's possible to mistype a conditional as `err == nil` when it should be `err != nil`. It's a really dumb mistake, but will waste time as you track it down (without the compiler's help).
Re:Announcing Rust 1.13 by stouset on Thursday November 10, 2016 @06:11PM (#12925499)
Not to mention forgetting to `return` nil, err. If you just type `nil, err`, you don't handle the error and nothing complains. Oops.
Re:Announcing Rust 1.13 by iand on Thursday November 10, 2016 @06:38PM (#12925765)
Re:Announcing Rust 1.13 by stouset on Thursday November 10, 2016 @08:01PM (#12926404)
Is this a recent change? I've with 100% been bitten by this before, repeatedly, and the go compiler did nothing to warn about it.
Re:Announcing Rust 1.13 by masklinn on Friday November 11, 2016 @04:57AM (#12929298)
Maybe for a side-effecting function which would only return an error?

edit: nope, fails with "err evaluated but not used".

Re:Announcing Rust 1.13 by stouset on Friday November 11, 2016 @01:51PM (#12933170)
I'm genuinely stumped. If they've fixed this, that's fantastic because I have absolutely shipped code with this bug to a production environment.
Re:Announcing Rust 1.13 by iand on Friday November 11, 2016 @04:22PM (#12934474)
I've been working with Go for 4 years and I've not encountered it. Perhaps there was an edge case where it was allowed, but I don't recall it.