|
|
|
|
|
by SirWart
3557 days ago
|
|
I got bit by this the other day when returning a nil pointer to a struct as an error. It was incredibly frustrating when I finally figured out what was going on, and I'm curious if there's a good reason to distinguish between these 2 types of nil or if it was just an oversight/mistake during the language design process. |
|
When a nil value is converted to an interface, it carries type information. When an interface carries type information, it isn't nil.