The compiler is right. From the specifications: Card types :
Comparison operators == and! = Must be fully defined for key type operands; therefore, the key type should not be a function, map, or slice.
This restriction is applied transitively, if the key type is a structure to all fields of the structure, they must also observe the above rule, which
stuff2 []string
no.
EDIT:
As for map1 not tagged, perhaps this is an error, possibly due to the fact that MyMap was never referenced and, therefore, type checking was probably skipped.
source share