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

fix: Only consider pointer to structs when checking for embedded fields #161

Merged
merged 1 commit into from Dec 26, 2022

Conversation

erezrokah
Copy link
Contributor

@erezrokah erezrokah commented Oct 27, 2022

Sorry for the trouble but I've noticed this in our CI tests after updating to go-funk version with my fix.

This is a follow up to #159

We should only consider pointer to structs when looking at embedded structs, as non pointers can never be nil.
The previous code would panic on structs since I used IsNil which can only called on pointers to structs.

This fixes the issue and adds a test to catch the previous panic

@thoas thoas merged commit df1ff15 into thoas:master Dec 26, 2022
@erezrokah
Copy link
Contributor Author

Thanks for merging and release this @thoas!

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.

None yet

2 participants