A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-131.go
1packagemain
2
3import"fmt"
4
5typeNstruct{Vint}
6
7funcmain(){
8a:=&N{1}
9b:=&N{1}
10varx,yinterface{}=a,b
11fmt.Println(x==y)
12}
Interfaces
Answer & explanation
Console output
false
Why
When two interfaces hold pointers of the same type, equality compares the pointer values (addresses), not what they point to. a and b are distinct allocations with different addresses, so x == y is false even though both point to an N with V==1. To compare contents, dereference and compare the structs.