3 ms·
Agree, 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
by catlifeonmars 6y ago
Agree, 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