News for hackers. Stuff that matters.
Re:Go proposal: Leave “if err != nil” alone? by gigatexal on Friday June 28, 2019 @01:50PM (#20306978)
Yeah I have a function like this: return a *struct, err where a nil struct could be the result of a empty result from the database query that was just run or an error if the query had an error. And then the logic of that function is if a job was returned quit early (I’m preventing two things from happening on the DB side). But then there’s an annoying dance of checking if the job is nil and the error is nil that’s the happy path... you can see how this makes the just if the check err is nil usual path welcome

There are no comments on this comment yet.