tag:blogger.com,1999:blog-11565005.post28251587530693284..comments2023-03-29T06:17:21.481-06:00Comments on The Software Life: Go: When nil isn't nilAndrew McKinlayhttp://www.blogger.com/profile/14951795633428513769noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-11565005.post-53184356325125681982014-05-08T05:42:26.645-06:002014-05-08T05:42:26.645-06:00You can't know if an interface contains a nil ...You can't know if an interface contains a nil pointer without knowing the type of that nil pointer.<br />This is important because the meaning of that nil pointer is only defined within it's type. A nil []byte is perfectly useful.<br /><br />If a nil interface value was equal to an the value of an interface containing a nil pointer then there would be no way to distinguish between an interface containing a nil pointer and one that has no type or value.<br /><br />Similarly, an interface can contain values that can't be nil, like an int.<br />What should be the semantics of this?<br /><br />interface{}(5) == nilJesstahttps://www.blogger.com/profile/06837651109419168637noreply@blogger.com