This change enables using types with MarshalText/UnmarshalText as keys. This behaviour matches encoding/json and gopkg.in/yaml.v3 (one of, if not the most popular YAML library).
The only potential breaking change is that maps with unsupported key types only fail if there are elements in the map (see updated tests). This behaviour can be restored by adding the validation before iteration, but given the potential overhead, I didn't want to assume it would be desired.
This change enables using types with
MarshalText
/UnmarshalText
as keys. This behaviour matchesencoding/json
andgopkg.in/yaml.v3
(one of, if not the most popular YAML library).The only potential breaking change is that maps with unsupported key types only fail if there are elements in the map (see updated tests). This behaviour can be restored by adding the validation before iteration, but given the potential overhead, I didn't want to assume it would be desired.
Benchstat
Coverage