Structs as keys in Go maps
only comparable type can be used as a key (== ,!=). struct (not a pointer) is comparable in case it contains only comparable types.
In your example the map key is a pointer to the struct, not the struct itself. Pointers can be compared for equality even when the items they point to can't be compared. This comparison is not based on the contents of the item, but only on its memory address.