by bigwheels · 1mo ago · 0 comments
var i interface{} // (Type: nil, Value: nil) -> i == nil is TRUE
var p *int = nil // p is nil
i = p // (Type: *int, Value: nil) -> i == nil is FALSE!I don't blame people for being confused by this the first time they encounter it. However, anyone who finds it persistently challenging to understand is not going to have much luck with the subtler language features of C++, Rust, Typescript, etc.
void *p=0;
void **pp=0;
assert(pp == 0);
pp=&p;
assert(pp != 0);
assert(*pp == 0);