A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-48.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6varainterface{}="x"
7varbinterface{}=1
8fmt.Println(a==b)
9}
Interfaces
Answer & explanation
Console output
false
Why
When comparing two interface values with differing dynamic types (string vs int), Go returns false immediately. The underlying values are never compared. Equality requires the dynamic types to be identical first. Comparing interfaces of mismatched types is well-defined and simply yields false (it does not panic).