|
|
|
|
|
by barsonme
3951 days ago
|
|
> Here's a trick that I expected to work but doesn't. Would be interested to hear the rationale if anyone knows it. Per the spec[0]: The comparison operators == and != must be fully defined for operands
of the key type; thus the key type must not be a function, map, or
slice. If the key type is an interface type, these comparison
operators must be defined for the dynamic key values; failure will
cause a run-time panic.
[0] - https://golang.org/ref/spec#Map_types |
|