A value
x
of non-interface typeX
and a valuet
of interface typeT
can be compared if typeX
is comparable andX
implementsT
. They are equal ift
's dynamic type is identical toX
andt
's dynamic value is equal tox
.
https://go.dev/ref/spec#Comparison_operators
so in the example above, everything implements any
, so hello
can be compared
against any comparable
type. but they will only be equal if the types are equal
and values are equal