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

feat: support ToMap for arrays too #130

Merged
merged 1 commit into from
Oct 13, 2021
Merged

Conversation

yangtau
Copy link
Contributor

@yangtau yangtau commented Sep 21, 2021

This PR:

  • ToMap() is currently only for slices. This PR adds support to arrays.
  • Panic when pivot is not a field of the struct.
    Before this PR, the panic message was ambiguous:
    panic: interface conversion: reflect.Type is nil, not *reflect.rtype [recovered]
        panic: interface conversion: reflect.Type is nil, not *reflect.rtype
    
    Now:
    panic: `Id` must be a field of the struct Foo [recovered]
            panic: `Id` must be a field of the struct Foo
    

@yangtau yangtau force-pushed the feat/array-to-map branch 4 times, most recently from 402bbb0 to 5c62b29 Compare September 21, 2021 13:46
@thoas thoas merged commit 2f4b463 into thoas:master Oct 13, 2021
@thoas
Copy link
Owner

thoas commented Oct 13, 2021

thank you @yangtau, great changes!

@yangtau yangtau deleted the feat/array-to-map branch October 14, 2021 05:37
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.

2 participants