Hacker News new | ask | show | jobs
by stouset 1488 days ago
You can't. But you can absolutely have a `nil` that will unavoiad runtime panics if you don't check it. And further, you only can't do this because go defines by fiat that the zero-value of a type must be legal. Of course, this is wildly inconvenient and annoying for many types, including those that come bundled in the standard library.

There are other, very convincingly better options to this that many in this thread have been trying to teach you about in the expectation that your responses have been in good faith.