3 ms·
Pointers don't normally compare equal to the thing they're pointing to. If it's acting as a proxy it's confusing the specific way that some things get proxied
by Dylan16807 6y ago
Pointers don't normally compare equal to the thing they're pointing to.
If it's acting as a proxy it's confusing the specific way that some things get proxied and other things don't.
- catlifeonmars 6y agoAgree, r == b in this example is confusing because in all other instances, the interface{} is a kind of box type. That box type is implicitly unwrapped in the r == b comparison. Although more verbose, I’d be happy with having to do something like this for comparison: b2, ok := r.(*bytes.Buffer) equal := ok && b2 == b
- cratermoon 6y agolaughs in C