Skip to content

Allow custom string types as map keys#414

Merged
arp242 merged 1 commit into
masterfrom
kt
Jun 4, 2024
Merged

Allow custom string types as map keys#414
arp242 merged 1 commit into
masterfrom
kt

Conversation

@arp242

@arp242 arp242 commented Jun 4, 2024

Copy link
Copy Markdown
Collaborator

Because the map keys were converted to []string,
rv.MapIndex(reflect.ValueOf(mapKey)) would panic as it's the "wrong" type (string, instead of the custom string type).

Just keep track of the reflect.Value instead; don't really need to convert it to strings.

Fixes #413

Because the map keys were converted to []string,
rv.MapIndex(reflect.ValueOf(mapKey)) would panic as it's the "wrong"
type (string, instead of the custom string type).

Just keep track of the reflect.Value instead; don't really need to
convert it to strings.

Fixes #413
@arp242
arp242 merged commit 7234339 into master Jun 4, 2024
@arp242
arp242 deleted the kt branch June 4, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic when marshalling a map with the key in a custom string type

1 participant