News for hackers. Stuff that matters.
Re:I Want Off Mr. Golang's Wild Ride by hota_mazi on Friday February 28, 2020 @12:54PM (#22444700)
Go does absolutely nothing to ensure you handle the error.

The only thing in Go source code that you see more often than the boiler plate "if err != nil" is "a, _ = foo()".

It's all too easy to ignore an error in Go.

Re:I Want Off Mr. Golang's Wild Ride by Sphax on Friday February 28, 2020 @01:13PM (#22444906)
> The only thing in Go source code that you see more often than the boiler plate "if err != nil" is "a, _ = foo()".

Where did you see that ? because that's not been my experience at all, and I've looked at a lot of Go code.

Re:I Want Off Mr. Golang's Wild Ride by shazow on Friday February 28, 2020 @02:11PM (#22445403)
> Go does absolutely nothing to ensure you handle the error.

Go has many community linters available, https://github.com/kisielk/errcheck is popular for checking unhandled errors.

If you'd like a combo-pack, check out https://github.com/golangci/golangci-lint which includes all of the popular linters in a configurable way.

Re:I Want Off Mr. Golang's Wild Ride by apta on Friday February 28, 2020 @03:42PM (#22446159)
Those linters won't catch everything. There are cases that will slip by. Rust's error handling, as well as exceptions are both strictly superior to golang's error handling.
Re:I Want Off Mr. Golang's Wild Ride by Thaxll on Friday February 28, 2020 @02:18PM (#22445462)
This is fud, I've never seen in Go code people dropping the err with _.

The reason why you don't see that is because you have to be explicit about that, it's not something you forget it's done on purpose which obviously no one does.

Re:I Want Off Mr. Golang's Wild Ride by apta on Friday February 28, 2020 @03:46PM (#22446193)
Just because you haven't seen it doesn't mean it doesn't exist. It's very easy to mishandle errors in golang, I've seen it several times now.