A value that looks equal to another is not necessarily comparable with `==`. Adding a slice field to a struct makes `cust1 == cust2` fail to compile, even when both slices contain the same values. Slices and maps cannot be compared with `==` or `!=`; a struct can be compared only when its fields can be compared. section 3.13
This distinction matters for generic map keys. `any` permits types that cannot be map keys, such as slices. The predeclared `comparable` constraint restricts a key type parameter to types whose values support `==` and `!=`, while leaving the value type unrestricted. section 2.9.1
func getKeys[K comparable, V any](m map[K]V) []K { #1
var keys []K #2
for k := range m {
keys = append(keys, k)
}
return keys
}
The key-extraction function uses `K comparable` for map keys and `V any` for values; its result retains the key type as `[]K`. section 2.9.1
An `any` variable introduces a different trap. Comparing two `any` values holding integers prints `true`, but comparing two that hold structs with slice fields compiles and then panics at run time. For values containing slices, use `reflect.DeepEqual` or define an equality method that compares the relevant fields and slice elements. section 3.13


