Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom string types as map keys #414

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Allow custom string types as map keys #414

merged 1 commit into from
Jun 4, 2024

Conversation

arp242
Copy link
Collaborator

@arp242 arp242 commented Jun 4, 2024

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
13 checks passed
@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