Here's what the Go langauge specification says about comparing interface values:

Two interface values are equal if they have identical dynamic types and equal dynamic values or if both have value nil.

The value in i1 has the named type T . The value in i2 has the anonymous type *struct{string} . Because the two values have different dynamic types, the interface values are not equal.

To see the types, add this line to your program:

fmt.Printf("i1: %T, i2: %T

", i1, i2)

This line will print: