News for hackers. Stuff that matters.
Re:Down the Golang Nil Rabbit Hole by khyryk on Tuesday March 30, 2021 @11:54AM (#26636135)
I bet there's a ton of Go code out there with methods that assume the pointer receiver cannot be nil without actually checking. The need for the nil checks along with != err everywhere makes for some incredibly verbose code.
Re:Down the Golang Nil Rabbit Hole by saturn_vk on Tuesday March 30, 2021 @03:27PM (#26639203)
I find that would be a bit pointless. Unless you can actually recover from that, it's better to just panic, since you clearly don't want a nil receiver
Re:Down the Golang Nil Rabbit Hole by khyryk on Tuesday March 30, 2021 @04:12PM (#26639788)
Then we're back to the nil interface problem: how do you know whether thing you got is nil or not?