News for hackers. Stuff that matters.
Re:Nil in Go is typed in theory and sort of untyped in practice by stcredzero on Wednesday March 31, 2021 @02:01PM (#26650713)
I'd much prefer it if in golang, the type of nil was some "nilType" for which != and == is defined for all other types. Or, define some other operation, like isNil()

Then determining if something is nil could be done without thinking about it at all. nil would be nil would be nil. (Also, it would be illegal to put methods on nilType, of course.)

(Yes, I make my living writing go, and this would make my life easier. And no, in that case, don't allow x := nil.)

There are no comments on this comment yet.